Struct MediaInfo (0.5.0)

媒體專屬使用者事件資訊。

欄位

media_progress_duration

媒體進度時間 (以秒為單位,如適用)。舉例來說,如果使用者已播放 90 秒的影片,則 [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds] 應設為 90。

media_progress_percentage

計算媒體進度時,應只使用 media_progress_duration,並與媒體總長度比較。

這個值必須介於 [0, 1.0] 之間 (含)。

如果這不是播放內容,或無法計算進度 (例如進行中的直播),則不應設定這個欄位。

實作

新推出

 fn new() -> Self

set_media_progress_duration

 fn set_media_progress_duration<T>(self, v: T) -> Self
where
    T: std::convert::Into<wkt::Duration>,

設定 [media_progress_duration][crate::model::MediaInfo::media_progress_duration] 的值。

set_or_clear_media_progress_duration

 fn set_or_clear_media_progress_duration<T>(self, v: std::option::Option<T>) -> Self
where
    T: std::convert::Into<wkt::Duration>,

設定或清除 [media_progress_duration][crate::model::MediaInfo::media_progress_duration] 的值。

set_media_progress_percentage

 fn set_media_progress_percentage<T>(self, v: T) -> Self
where
    T: std::convert::Into<f32>,

設定 [media_progress_percentage][crate::model::MediaInfo::media_progress_percentage] 的值。

set_or_clear_media_progress_percentage

 fn set_or_clear_media_progress_percentage<T>(self, v: std::option::Option<T>) -> Self
where
    T: std::convert::Into<f32>,

設定或清除 [media_progress_percentage][crate::model::MediaInfo::media_progress_percentage] 的值。