VideoPlayer - stingray.VideoPlayer object reference - Stingray Lua API Reference

stingray.VideoPlayer object reference

Description

An object that can play video.

You can create a video player with World.create_video_player(). After creating a video player, you can use it in a Gui with the Gui.video() function.

Note: The video playback system is under development. It only works on Win32 and the interfaces must be considered temporary.

Functions

Parameters
This function does not accept any parameters.
Returns

integer

Returns the number of frames that has been showed.

This is zero before the first frame is shown and number_of_frames after the entire video is shown. If the video is set to loop, this value is reset to 0 for the next frame in the loop. Use VideoPlayer.times_looped() to determine how many times this has occurred.

Parameters
This function does not accept any parameters.
Returns

boolean

Returns true if the video contains audio and the VideoPlayer supports it.

Parameters
This function does not accept any parameters.
Returns

integer

Returns the total number of frames.

Parameters

loop :

boolean

Specifies whether the video must loop (true or false).

Returns
This function does not return any values.
Parameters

video_player :

stingray.VideoPlayer

Reference to the VideoPlayer.

speed :

number

The speed at which the video must be played.

Returns
This function does not return any values.

A speed of zero pauses the video. The speed must be positive because the video cannot be played backwards.

Note: Videos use the wall timer rather than the timer of the world in which they live. This is because videos must synch with sounds that are always played in "real time". If you pause the world that the video lives in, the video still continues to play unless you explicitly pause it using set_playback_speed().

Parameters

enabled :

boolean

Specifies whether the video player's sound stream should be filled during playback.

Returns
This function does not return any values.

By default the sound stream is not filled by data during video playback. Using the Timpani system to trigger a video event will automatically enable the sound stream buffer and audio playback via Timpani. To use an alternate system, such as Wwise, to play the video audio, the sound stream must be enabled and retrieved via stingray.VideoPlayer.sound_stream_source to be fed to the other system.

Parameters
This function does not accept any parameters.
Returns

stingray.SoundStreamSource

The audio stream source associated with this Video.

Parameters
This function does not accept any parameters.
Returns

integer

Returns the number of times the video has looped back.

If the looping is not enabled, this returns false.