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
Name | Type | Description |
---|---|---|
audioTrack [get, set]
|
long | The embedded audio track to play. |
autoplay [get, set]
|
bool | If true , playback starts when the scene loads.
|
bufferingMsec [get, set]
|
long | Amount of time in milliseconds to store in buffer while playing. |
bus [get, set]
|
String | Audio bus to use for sound playback. |
expand [get, set]
|
bool | If 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]
|
bool | If true , the video is paused.
|
stream [get, set]
|
VideoStream | The assigned video stream. See description for supported formats. |
streamPosition [get, set]
|
double | The current position of the stream, in seconds. |
volume [get, set]
|
double | Audio volume as a linear value. |
volumeDb [get, set]
|
double | Audio volume in dB. |
Methods
Name | Description |
---|---|
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. |