Main   Class List   Namespace List   Wiki

GuiTheoraCtrl Class Reference
[Image and Video Controls]

A control to playing Theora videos. More...

Inheritance diagram for GuiTheoraCtrl:
Inheritance graph
[legend]

List of all members.

Public Member Functions

float getCurrentTime ()
 Get the current playback time.
bool isPlaybackDone ()
 Test whether the video has finished playing.
void pause ()
 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.

Public Attributes

Playback

ColorI backgroundColor
 Fill color when video is not playing.
bool matchVideoSize
 Whether to automatically match control extents to the video size.
bool playOnWake
 Whether to start playing video when control is woken up.
bool renderDebugInfo
 If true, displays an overlay on top of the video with useful debugging information.
bool stopOnSleep
 Whether to stop video when control is set to sleep.
filename theoraFile
 Theora video file to play.
GuiTheoraTranscoder transcoder
 The routine to use for Y'CbCr to RGB conversion.

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.

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

Canvas.setContent( %video );
%video.play();
See also:
http://www.theora.org

Member Function Documentation

float GuiTheoraCtrl::getCurrentTime (  ) 

Get the current playback time.

Returns:
The elapsed playback time in seconds.
bool GuiTheoraCtrl::isPlaybackDone (  ) 

Test whether the video has finished playing.

Returns:
True if the video has finished playing, false otherwise.
void GuiTheoraCtrl::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.

void GuiTheoraCtrl::play (  ) 

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

void GuiTheoraCtrl::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.
void GuiTheoraCtrl::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.


Member Data Documentation

Fill color when video is not playing.

Whether to automatically match control extents to the video size.

Whether to start playing video when control is woken up.

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

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.

Theora video file to play.

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



Copyright © GarageGames, LLC. All Rights Reserved.