VideoStreamPlayer
繼承: Control < CanvasItem < Node < Object
用於播放影片的控制項。
說明
A control used for playback of VideoStream resources.
Supported video formats are Ogg Theora (.ogv, VideoStreamTheora) and any format exposed via a GDExtension plugin.
Warning: On Web, video playback will perform poorly due to missing architecture-specific assembly optimizations.
教學
屬性
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
方法
get_stream_length() const |
|
get_stream_name() const |
|
get_video_texture() const |
|
is_playing() const |
|
void |
play() |
void |
stop() |
訊號
finished() 🔗
播放結束時觸發。
屬性說明
要播放的嵌入式音軌。
如果為 true,當場景載入時開始播放。
播放時儲存在緩衝區的時間,以毫秒計。
StringName bus = &"Master" 🔗
void set_bus(value: StringName)
StringName get_bus()
用於聲音播放的音訊匯流排。
如果為 true,影片會縮放到控制項的尺寸。否則,控制項的最小尺寸將被自動調整以配對影片流的尺寸。
如果為 true,當流到達末尾時將自動迴圈。
如果為 true,則暫停影片。
The stream's current speed scale. 1.0 is the normal speed, while 2.0 is double speed and 0.5 is half speed. A speed scale of 0.0 pauses the video, similar to setting paused to true.
VideoStream stream 🔗
void set_stream(value: VideoStream)
VideoStream get_stream()
指定的影片流。支援的格式見描述。
The current position of the stream, in seconds.
音訊音量為線性值。
音訊音量,單位是 dB。
方法說明
float get_stream_length() const 🔗
The length of the current stream, in seconds.
String get_stream_name() const 🔗
返回影片流的名稱,如果沒有指定影片流,則返回 "<No Stream>"。
Texture2D get_video_texture() const 🔗
將目前影格作為 Texture2D 返回。
如果影片正在播放,返回 true。
注意:如果在播放過程中暫停,影片仍被認為在播放。
void play() 🔗
從頭開始播放影片。如果影片處於暫停狀態,不會取消暫停。
void stop() 🔗
停止影片播放並將影片流位置設定為 0。
注意:雖然影片流位置將被設定為 0,但影片流的第一影格不會成為目前影格。