pub struct PlaybackStatus {Show 13 fields
pub url: String,
pub current_time: f64,
pub playing: bool,
pub ended: bool,
pub ended_pending: bool,
pub waiting_pending: bool,
pub playing_pending: bool,
pub stalled_pending: bool,
pub total_video_frames: u32,
pub dropped_video_frames: u32,
pub volume: f64,
pub muted: bool,
pub playback_rate: f64,
}Expand description
再生スレッドが書き、JS(currentTime/paused/ended/getVideoPlaybackQuality)と
描画ループ(timeupdate/ended イベント)が読む再生状態。
【2026-10-17】従来の currentTime 等は内部属性を返すだけで、実際の再生と無関係だった。
Fields§
§url: String再生中(または最後に再生した)<video> の src。
current_time: f64表示中のフレームの時刻(秒)。
playing: bool§ended: bool§ended_pending: bool終了をまだ JS に知らせていない(描画ループが ended を発火したら false)。
waiting_pending: boolバッファ待機状態(waiting)をまだ JS に知らせていない
playing_pending: bool再生開始・再開(playing)をまだ JS に知らせていない
stalled_pending: boolデータ取得停滞(stalled)をまだ JS に知らせていない
total_video_frames: u32デコード・表示した累計フレーム数(getVideoPlaybackQuality().totalVideoFrames 用)。
dropped_video_frames: u32ドロップまたはデコード失敗したフレーム数(getVideoPlaybackQuality().droppedVideoFrames 用)。
volume: f64現在の音量(0.0〜1.0、既定 1.0)。
muted: boolミュート状態(既定 false)。
playback_rate: f64再生速度(既定 1.0)。
Implementations§
Source§impl PlaybackStatus
impl PlaybackStatus
pub const fn new() -> Self
Sourcepub fn should_resume(&self, url: &str) -> bool
pub fn should_resume(&self, url: &str) -> bool
同じ URL で一時停止中(!ended && current_time > 0.0)から再開すべきかを返す。
Sourcepub fn set_volume(&mut self, v: f64) -> bool
pub fn set_volume(&mut self, v: f64) -> bool
音量を 0.0〜1.0 の範囲で設定する(範囲外や NaN は無視して false を返す)。
Sourcepub fn set_playback_rate(&mut self, r: f64) -> bool
pub fn set_playback_rate(&mut self, r: f64) -> bool
再生速度を 0.25〜4.0 にクランプして設定する(0 以下や非有限は無視して false)。
Trait Implementations§
Source§impl Clone for PlaybackStatus
impl Clone for PlaybackStatus
Source§fn clone(&self) -> PlaybackStatus
fn clone(&self) -> PlaybackStatus
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PlaybackStatus
impl Debug for PlaybackStatus
Source§impl PartialEq for PlaybackStatus
impl PartialEq for PlaybackStatus
impl StructuralPartialEq for PlaybackStatus
Auto Trait Implementations§
impl Freeze for PlaybackStatus
impl RefUnwindSafe for PlaybackStatus
impl Send for PlaybackStatus
impl Sync for PlaybackStatus
impl Unpin for PlaybackStatus
impl UnsafeUnpin for PlaybackStatus
impl UnwindSafe for PlaybackStatus
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more