DIFF

class VideoWidgetSource

VideoWidget Widget Managed

Part of Widget UI system

All members, including inherited

Methods 17

proto native bool Load(string name, bool looping = false, int startTime = 0)

Load a video file Return is deprecated, treat as void and use 'VideoCallback.ON_ERROR'

proto native void Unload()

Unload the video, freeing up all resources

proto native bool Play()

Starts video playback Return is deprecated, treat as void and use 'VideoCallback.ON_ERROR'

proto native bool Pause()

Pauses video playback Return is deprecated, treat as void and use 'VideoCallback.ON_ERROR'

proto native bool Stop()

Stop video playback (cancels everything and sets it back at time 0) Return is deprecated, treat as void and use 'VideoCallback.ON_ERROR'

proto native bool SetTime(int time, bool preload)

Set the desired time for the video (preload decides whether it will already load the next frames too) Return is deprecated, treat as void and use 'VideoCallback.ON_ERROR'

Referenced by VideoPlayer.OnChange(), and Play()
proto native int GetTime()

Get the current time of the video

proto native int GetTotalTime()

Get the total time of the video

proto native void SetLooping(bool looping)

Set whether the video should loop

proto native bool IsLooping()

Whether looping is enabled

proto native bool IsPlaying()

QoL direct method to check for playing state (buffering while playing will still return true)

proto native VideoState GetState()

Get the current state of the video

proto native void DisableSubtitles(bool disable)

Enable/Disable subtitles

NoteSubtitles are in the format "videoName_Language.srt"
NoteIt is best to have the English one without language specified "videoName.srt"
WarningSubtitles need font to be assigned to VideoWidget in layout to work
proto native bool IsSubtitlesDisabled()

Check if subtitles are disabled (enabled by default if available, so it will return false even if there are none)

proto void SetCallback(VideoCallback cb, func fn)

Set a callback for a certain video event

int Play(VideoCommand cmd)

Legacy, preferably not used, left for backwards compat

References GetTime(), IsPlaying(), Pause()
Show 3 more, SetLooping(), SetTime(), and Unload()
bool LoadVideo(string name, int soundScene)

Legacy, preferably not used, left for backwards compat

References Load()