pub struct VideoStreamData {Show 13 fields
pub quality: u32,
pub accept_quality: Vec<u32>,
pub accept_format: String,
pub accept_description: Vec<String>,
pub format: String,
pub video_codecid: u32,
pub durl: Option<Vec<Durl>>,
pub dash: Option<DashStreams>,
pub has_paid: bool,
pub support_formats: Vec<SupportFormat>,
pub timelength: Option<u64>,
pub fnval: Option<u32>,
pub is_preview: Option<u32>,
}Expand description
通用视频流响应数据
Fields§
§quality: u32当前分辨率代码
accept_quality: Vec<u32>分辨率代码列表
accept_format: String支持的格式
accept_description: Vec<String>分辨率描述
format: String当前格式
video_codecid: u32视频编码ID
durl: Option<Vec<Durl>>FLV/MP4 直链(可选)
dash: Option<DashStreams>DASH 流(可选)
has_paid: bool是否已付费
support_formats: Vec<SupportFormat>支持的格式列表
timelength: Option<u64>时长,毫秒
fnval: Option<u32>fnval参数
is_preview: Option<u32>是否为预览
Implementations§
Source§impl VideoStreamData
impl VideoStreamData
Sourcepub fn best_format(&self) -> Option<&SupportFormat>
pub fn best_format(&self) -> Option<&SupportFormat>
获取最佳格式
Sourcepub fn best_video(&self) -> Option<&DashTrack>
pub fn best_video(&self) -> Option<&DashTrack>
获取最佳视频流
Sourcepub fn best_audio(&self) -> Option<&DashTrack>
pub fn best_audio(&self) -> Option<&DashTrack>
获取最佳音频流
Sourcepub fn supports_dash(&self) -> bool
pub fn supports_dash(&self) -> bool
检查是否支持DASH格式
Sourcepub fn supports_direct_url(&self) -> bool
pub fn supports_direct_url(&self) -> bool
检查是否支持直链格式
Sourcepub fn duration_seconds(&self) -> Option<u64>
pub fn duration_seconds(&self) -> Option<u64>
获取视频时长(秒)
Trait Implementations§
Source§impl Clone for VideoStreamData
impl Clone for VideoStreamData
Source§fn clone(&self) -> VideoStreamData
fn clone(&self) -> VideoStreamData
Returns a duplicate of the value. Read more
1.0.0 · 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 VideoStreamData
impl Debug for VideoStreamData
Source§impl<'de> Deserialize<'de> for VideoStreamData
impl<'de> Deserialize<'de> for VideoStreamData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for VideoStreamData
impl RefUnwindSafe for VideoStreamData
impl Send for VideoStreamData
impl Sync for VideoStreamData
impl Unpin for VideoStreamData
impl UnwindSafe for VideoStreamData
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