A Video object provides video-only playback.
The current playing video frame can be set as pixel data on a Texture object. The framerate of a video may be lower than the framerate of the game so it is recomended to check if the current playback possition has changed before setting it to a texture, for example:
var currentVideoPosition = video.tell;
if (currentVideoPosition &&
lastUpdateVideoPosition !== currentVideoPosition)
{
lastUpdateVideoPosition = currentVideoPosition;
texture.setData(video);
}
A video object should always be destroyed when no longer needed, for example:
function cutSceneEnd()
{
if (video)
{
video.destroy();
video = null;
}
};
A Video object can be constructed with GraphicsDevice.createVideo.
Summary
Play the given video.
Syntax
video.play(position);
Summary
Stop the video playback. If you pause you have to resume it before stopping.
Syntax
video.stop();
Returns true if the video was playing, false otherwise.
Summary
Pause the video playback.
Syntax
video.pause();
Returns true if the video was playing, false otherwise.
Summary
Resume the video playback.
Syntax
video.resume(position);
Returns true if the video was paused, false otherwise.
Summary
Rewind the playback position to the start of the video.
Syntax
video.rewind();
Returns true if the playback position was not already at the start of the video, false otherwise.
Summary
Releases the Video; the object will be invalid after the method is called.
Syntax
video.destroy();
Summary
True if the video should start playing again from the start when reaching the end, false if the video should stop when reaching the end.
Syntax
if (video.looping)
{
}
Note
Read Only
Summary
True if the video is playing the video right now, false otherwise.
Syntax
if (video.playing)
{
}
Note
Read Only
Summary
True if the video has been paused, false otherwise.
Syntax
if (video.paused)
{
}
Note
Read Only
Summary
The current playback position in seconds, zero if playback has not started.
Syntax
var currentPlaybackPosition = video.tell;
Note
Read Only