gs.Video Class
Allows to display videos on screen. The supported video formats depends on the platform. Only WEBM is supported right now.
Constructor
gs.Video
-
filePath
-
[languageCode=null]
Parameters:
-
filePath
String- The path to the video resource.
-
[languageCode=null]
String optional- The language code to load the video resource depending on language.
Item Index
Methods
dispose
()
Disposes the video and frees resources/memory. Should be called if the video is no longer needed.
pause
()
Pauses the video.
play
()
Disposes the video and frees resources/memory. Should be called if the video is no longer needed.
stop
()
Stops the video.
update
()
Updates the video. Needs to be called once per frame.
Properties
disposed
Boolean
Indicates if the video is disposed.
filePath
String
The path to the video resource.
height
Number
The video's height.
isPlaying
Boolean
Indicates if the video is currently playing.
loaded
Boolean
Indicates if the video is loaded.
loop
Boolean
Indicates if the video repeats after finished playing.
onCanPlay
Function
Callback function called if the video is ready to play.
onEnded
Function
Callback function called if an the video finished playing.
onError
Function
Callback function called if an error occurred.
playbackRate
Number
The play-back rate in percent.
volume
Number
The volume of the video's audio. Goes from 0 to 100 percent.
width
Number
The video's width.