Skip to main content

PlaybackStatus

Struct PlaybackStatus 

Source
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

Source

pub const fn new() -> Self

Source

pub fn should_resume(&self, url: &str) -> bool

同じ URL で一時停止中(!ended && current_time > 0.0)から再開すべきかを返す。

Source

pub fn set_volume(&mut self, v: f64) -> bool

音量を 0.0〜1.0 の範囲で設定する(範囲外や NaN は無視して false を返す)。

Source

pub fn set_playback_rate(&mut self, r: f64) -> bool

再生速度を 0.25〜4.0 にクランプして設定する(0 以下や非有限は無視して false)。

Trait Implementations§

Source§

impl Clone for PlaybackStatus

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Debug for PlaybackStatus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for PlaybackStatus

Source§

fn eq(&self, other: &PlaybackStatus) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PlaybackStatus

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.