Struct VideoPlayer

Control for playing video streams.

struct VideoPlayer ;

Control node for playing video streams using VideoStream resources. Supported video formats are url=https://www.webmproject.org/WebM/url (VideoStreamWebm), url=https://www.theora.org/Ogg Theora/url (VideoStreamTheora), and any format exposed via a GDNative plugin using VideoStreamGDNative.

Properties

NameTypeDescription
audioTrack[get, set] longThe embedded audio track to play.
autoplay[get, set] boolIf true, playback starts when the scene loads.
bufferingMsec[get, set] longAmount of time in milliseconds to store in buffer while playing.
bus[get, set] StringAudio bus to use for sound playback.
expand[get, set] boolIf true, the video scales to the control size. Otherwise, the control minimum size will be automatically adjusted to match the video stream's dimensions.
paused[get, set] boolIf true, the video is paused.
stream[get, set] VideoStreamThe assigned video stream. See description for supported formats.
streamPosition[get, set] doubleThe current position of the stream, in seconds.
volume[get, set] doubleAudio volume as a linear value.
volumeDb[get, set] doubleAudio volume in dB.

Methods

NameDescription
getAudioTrack
getBufferingMsec
getBus
getStream
getStreamName Returns the video stream's name, or "<No Stream>" if no video stream is assigned.
getStreamPosition
getVideoTexture Returns the current frame as a Texture.
getVolume
getVolumeDb
hasAutoplay
hasExpand
isPaused
isPlaying Returns true if the video is playing. Note: The video is still considered playing if paused during playback.
play Starts the video playback from the beginning. If the video is paused, this will not unpause the video.
setAudioTrack
setAutoplay
setBufferingMsec
setBus
setExpand
setPaused
setStream
setStreamPosition
setVolume
setVolumeDb
stop Stops the video playback and sets the stream position to 0. Note: Although the stream position will be set to 0, the first frame of the video stream won't become the current frame.