Skip to content

Latest commit

 

History

History
207 lines (128 loc) · 10.7 KB

class_videoplayer.rst

File metadata and controls

207 lines (128 loc) · 10.7 KB

VideoPlayer

Inherits: Control<class_control> < CanvasItem<class_canvasitem> < Node<class_node> < Object<class_object>

Category: Core

Brief Description

Control to play video files.

Member Functions

int<class_int> get_audio_track<class_VideoPlayer_get_audio_track> ( ) const
int<class_int> get_buffering_msec<class_VideoPlayer_get_buffering_msec> ( ) const
VideoStream<class_videostream> get_stream<class_VideoPlayer_get_stream> ( ) const
String<class_string> get_stream_name<class_VideoPlayer_get_stream_name> ( ) const
float<class_float> get_stream_pos<class_VideoPlayer_get_stream_pos> ( ) const
Texture<class_texture> get_video_texture<class_VideoPlayer_get_video_texture> ( )
float<class_float> get_volume<class_VideoPlayer_get_volume> ( ) const
float<class_float> get_volume_db<class_VideoPlayer_get_volume_db> ( ) const
bool<class_bool> has_autoplay<class_VideoPlayer_has_autoplay> ( ) const
bool<class_bool> has_expand<class_VideoPlayer_has_expand> ( ) const
bool<class_bool> is_paused<class_VideoPlayer_is_paused> ( ) const
bool<class_bool> is_playing<class_VideoPlayer_is_playing> ( ) const
void play<class_VideoPlayer_play> ( )
void set_audio_track<class_VideoPlayer_set_audio_track> ( int<class_int> track )
void set_autoplay<class_VideoPlayer_set_autoplay> ( bool<class_bool> enabled )
void set_buffering_msec<class_VideoPlayer_set_buffering_msec> ( int<class_int> msec )
void set_expand<class_VideoPlayer_set_expand> ( bool<class_bool> enable )
void set_paused<class_VideoPlayer_set_paused> ( bool<class_bool> paused )
void set_stream<class_VideoPlayer_set_stream> ( VideoStream<class_videostream> stream )
void set_volume<class_VideoPlayer_set_volume> ( float<class_float> volume )
void set_volume_db<class_VideoPlayer_set_volume_db> ( float<class_float> db )
void stop<class_VideoPlayer_stop> ( )

Description

This control has the ability to play video streams. The only format accepted is the OGV Theora, so any other format must be converted before using in a project.

Member Function Description

  • int<class_int> get_audio_track ( ) const

Get the selected audio track (for multitrack videos).

  • int<class_int> get_buffering_msec ( ) const

Get the amount of miliseconds to store in buffer while playing.

  • VideoStream<class_videostream> get_stream ( ) const

Get the video stream.

  • String<class_string> get_stream_name ( ) const

Get the name of the video stream.

  • float<class_float> get_stream_pos ( ) const

Get the current position of the stream, in seconds.

  • Texture<class_texture> get_video_texture ( )

Get the current frame of the video as a Texture<class_texture>.

  • float<class_float> get_volume ( ) const

Get the volume of the audio track as a linear value.

  • float<class_float> get_volume_db ( ) const

Get the volume of the audio track in decibels.

  • bool<class_bool> has_autoplay ( ) const

Get whether or not the video is set as autoplay.

  • bool<class_bool> has_expand ( ) const

Get whether or not the expand property is set.

  • bool<class_bool> is_paused ( ) const

Get whether or not the video is paused.

  • bool<class_bool> is_playing ( ) const

Get whether or not the video is playing.

  • void play ( )

Start the video playback.

  • void set_audio_track ( int<class_int> track )

Set the audio track (for multitrack videos).

  • void set_autoplay ( bool<class_bool> enabled )

Set whether this node should start playing automatically.

  • void set_buffering_msec ( int<class_int> msec )

Set the amount of miliseconds to buffer during playback.

  • void set_expand ( bool<class_bool> enable )

Set the expand property. If enabled, the video will grow or shrink to fit the player size, otherwise it will play at the stream resolution.

  • void set_paused ( bool<class_bool> paused )

Set whether the video should pause the playback.

  • void set_stream ( VideoStream<class_videostream> stream )

Set the video stream for this player.

  • void set_volume ( float<class_float> volume )

Set the audio volume as a linear value.

  • void set_volume_db ( float<class_float> db )

Set the audio volume in decibels.

  • void stop ( )

Stop the video playback.