GuiTheoraCtrl

consoledoc.h

A control to playing Theora videos.

More...

Playback

filename

Theora video file to play.

ColorI

Fill color when video is not playing.

bool

Whether to start playing video when control is woken up.

bool

Loop playback.

bool

Whether to stop video when control is set to sleep.

bool

Whether to automatically match control extents to the video size.

bool

If true, displays an overlay on top of the video with useful debugging information.

The routine to use for Y'CbCr to RGB conversion.

Public Functions

float

Get the current playback time.

bool

Test whether the video has finished playing.

void

Pause playback of the video. If the video is not currently playing, the call is ignored.

void
play()

Start playing the video. If the video is already playing, the call is ignored.

void
setFile(string filename)

Set the video file to play. If a video is already playing, playback is stopped and the new video file is loaded.

void
stop()

Stop playback of the video. The next call to play() will then start playback from the beginning of the video.

Detailed Description

A control to playing Theora videos.

This control can be used to play videos in the Theora video format. The videos may include audio in Vorbis format. The codecs for both formats are integrated with the engine and no codecs must be present on the user's machine.

%video = new GuiTheoraCtrl()
{
   theoraFile = "videos/intro.ogv";
   playOnWake = false;
   stopOnSleep = true;
}

Canvas.setContent( %video );
%video.play();

see:

http://www.theora.org

Playback

filename theoraFile 

Theora video file to play.

ColorI backgroundColor 

Fill color when video is not playing.

bool playOnWake 

Whether to start playing video when control is woken up.

bool Loop 

Loop playback.

bool stopOnSleep 

Whether to stop video when control is set to sleep.

If this is not set to true, the video will be paused when the control is put to sleep. This is because there is no support for seeking in the video stream in the player backend and letting the time source used to synchronize video (either audio or a raw timer) get far ahead of frame decoding will cause possibly very long delays when the control is woken up again.

bool matchVideoSize 

Whether to automatically match control extents to the video size.

bool renderDebugInfo 

If true, displays an overlay on top of the video with useful debugging information.

GuiTheoraTranscoder transcoder 

The routine to use for Y'CbCr to RGB conversion.

Public Functions

getCurrentTime()

Get the current playback time.

return:

The elapsed playback time in seconds.

isPlaybackDone()

Test whether the video has finished playing.

return:

True if the video has finished playing, false otherwise.

pause()

Pause playback of the video. If the video is not currently playing, the call is ignored.

While stopped, the control displays the last frame.

play()

Start playing the video. If the video is already playing, the call is ignored.

setFile(string filename)

Set the video file to play. If a video is already playing, playback is stopped and the new video file is loaded.

Parameters:

filename

The video file to load.

stop()

Stop playback of the video. The next call to play() will then start playback from the beginning of the video.

While stopped, the control renders empty with just the background color.