26 m_Root =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/video_player.layout", parent);
52 m_LoadVideo.Show(
false);
55 m_Progress.SetCurrent(0);
61 m_Buffering.Show(
false);
64 m_VideoWidget.SetCallback(
VideoCallback.ON_PLAY, OnPlaybackStart);
65 m_VideoWidget.SetCallback(
VideoCallback.ON_PAUSE, OnPlaybackStop);
66 m_VideoWidget.SetCallback(
VideoCallback.ON_STOP, OnPlaybackStop);
67 m_VideoWidget.SetCallback(
VideoCallback.ON_END, OnPlaybackStop);
68 m_VideoWidget.SetCallback(
VideoCallback.ON_LOAD, OnPlaybackStop);
69 m_VideoWidget.SetCallback(
VideoCallback.ON_SEEK, UpdateCurrentTime);
70 m_VideoWidget.SetCallback(
VideoCallback.ON_BUFFERING_START, OnBufferingStart);
71 m_VideoWidget.SetCallback(
VideoCallback.ON_BUFFERING_END, OnBufferingEnd);
76 string path =
"video\\*";
94 Widget entry =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/video_player_entry.layout", m_LoadVideo);
102 int time = m_VideoWidget.GetTime();
105 m_Progress.SetCurrent(
time);
111 int time = m_VideoWidget.GetTotalTime();
116 m_Progress.SetMinMax(0,
time);
131 m_VideoWidget.SetTime(m_Progress.GetCurrent(),
finished);
138 if (
w == m_PlayButton)
140 else if (
w == m_PauseButton)
142 else if (
w == m_StopButton)
144 else if (
w == m_OnceButton)
146 else if (
w == m_RepeatButton)
148 else if (
w == m_LoadButton)
150 else if (
w == m_Progress)
156 else if (
w.GetUserID() == 333)
169 m_PlayButton.Show(
false);
170 m_PauseButton.Show(
true);
177 m_PlayButton.Show(
true);
178 m_PauseButton.Show(
false);
187 m_Buffering.Show(
true);
192 m_Buffering.Show(
false);
197 if (!m_LoadVideo.IsVisible())
211 m_LoadVideo.Show(!m_LoadVideo.IsVisible());
217#ifdef PLATFORM_WINDOWS
221 path =
"/app0/video/";
224 path =
"G:\\video\\";
227 m_VideoWidget.Load(
path +
videoPath, m_VideoWidget.IsLooping());
234 m_VideoWidget.Play();
239 m_VideoWidget.Pause();
244 m_VideoWidget.Stop();
245 m_PlayButton.Show(
true);
246 m_PauseButton.Show(
false);
251 m_VideoWidget.SetLooping(
false);
252 m_OnceButton.Show(
false);
253 m_RepeatButton.Show(
true);
258 m_VideoWidget.SetLooping(
true);
259 m_RepeatButton.Show(
false);
260 m_OnceButton.Show(
true);
265 m_VideoWidget.Unload();
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
struct that keeps Time relevant information for future formatting
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
proto native void CloseFindFile(FindFileHandle handle)
enum FindFileFlags FindFile(string pattern, out string fileName, out FileAttr fileAttributes, FindFileFlags flags)
proto bool FindNextFile(FindFileHandle handle, out string fileName, out FileAttr fileAttributes)