VideoPlayer

Inherits: Control < CanvasItem < Node < Object

Category: Core

Brief Description

Control to play video files.

Member Functions

int get_audio_track ( ) const
int get_buffering_msec ( ) const
VideoStream get_stream ( ) const
String get_stream_name ( ) const
float get_stream_pos ( ) const
Texture get_video_texture ( )
float get_volume ( ) const
float get_volume_db ( ) const
bool has_autoplay ( ) const
bool has_expand ( ) const
bool is_paused ( ) const
bool is_playing ( ) const
void play ( )
void set_audio_track ( int track )
void set_autoplay ( bool enabled )
void set_buffering_msec ( int msec )
void set_expand ( bool enable )
void set_paused ( bool paused )
void set_stream ( VideoStream stream )
void set_volume ( float volume )
void set_volume_db ( float db )
void 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 get_audio_track ( ) const

Get the selected audio track (for multitrack videos).

int get_buffering_msec ( ) const

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

VideoStream get_stream ( ) const

Get the video stream.

String get_stream_name ( ) const

Get the name of the video stream.

float get_stream_pos ( ) const

Get the current position of the stream, in seconds.

Texture get_video_texture ( )

Get the current frame of the video as a Texture.

float get_volume ( ) const

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

float get_volume_db ( ) const

Get the volume of the audio track in decibels.

bool has_autoplay ( ) const

Get whether or not the video is set as autoplay.

bool has_expand ( ) const

Get whether or not the expand property is set.

bool is_paused ( ) const

Get whether or not the video is paused.

bool is_playing ( ) const

Get whether or not the video is playing.

void play ( )

Start the video playback.

void set_audio_track ( int track )

Set the audio track (for multitrack videos).

void set_autoplay ( bool enabled )

Set whether this node should start playing automatically.

void set_buffering_msec ( int msec )

Set the amount of miliseconds to buffer during playback.

void set_expand ( 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 paused )

Set whether the video should pause the playback.

void set_stream ( VideoStream stream )

Set the video stream for this player.

void set_volume ( float volume )

Set the audio volume as a linear value.

void set_volume_db ( float db )

Set the audio volume in decibels.

void stop ( )

Stop the video playback.

© 2014–2020 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
https://docs.godotengine.org/en/2.1/classes/class_videoplayer.html