Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
VideoStreamPlayer
繼承: Control < CanvasItem < Node < Object
用於播放影片的控制項。
說明
用於播放 VideoStream 資源的控制項。
支援的影片格式有 Ogg Theora(.ogv,VideoStreamTheora)以及任何通過 GDExtension 外掛公開的格式。
警告:在 Web 上,影片播放會由於缺少特定於體系結構的匯編最佳化而表現不佳。
教學
屬性
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
方法
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,則暫停影片。
影片流的目前速度縮放。1.0 是正常速度,2.0 是二倍速,0.5 是半速。速度縮放為 0.0 會暫停影片,類似於將 paused 設定為 true。
VideoStream stream 🔗
void set_stream(value: VideoStream)
VideoStream get_stream()
指定的影片流。支援的格式見描述。
回傳影片流中的目前位置,單位為秒。
音訊音量為線性值。
音訊音量,單位是 dB。
方法說明
float get_stream_length() const 🔗
目前影片流的長度,單位為秒。
String get_stream_name() const 🔗
返回影片流的名稱,如果沒有指定影片流,則返回 "<No Stream>"。
Texture2D get_video_texture() const 🔗
Returns the video playback texture.
The texture will be continually updated as the video plays, so call Texture2D.get_image() to get a still frame.
如果影片正在播放,返回 true。
注意:如果在播放過程中暫停,影片仍被認為在播放。
void play() 🔗
Starts the video playback from the beginning, unless the video is already playing.
Note: If the video is paused, this will not unpause the video.
void stop() 🔗
停止影片播放並將影片流位置設定為 0。
注意:雖然影片流位置將被設定為 0,但影片流的第一影格不會成為目前影格。