#[non_exhaustive]pub struct VideoPlayer {Show 13 fields
pub details: VideoPlayerDetails,
pub video_streams: Vec<VideoStream>,
pub video_only_streams: Vec<VideoStream>,
pub audio_streams: Vec<AudioStream>,
pub subtitles: Vec<Subtitle>,
pub expires_in_seconds: u32,
pub valid_until: OffsetDateTime,
pub hls_manifest_url: Option<String>,
pub dash_manifest_url: Option<String>,
pub preview_frames: Vec<Frameset>,
pub drm: Option<VideoPlayerDrm>,
pub client_type: ClientType,
pub visitor_data: Option<String>,
}Expand description
Video player data
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.details: VideoPlayerDetailsVideo metadata
video_streams: Vec<VideoStream>List of streams containing both audio and video
video_only_streams: Vec<VideoStream>List of streams containing video only
audio_streams: Vec<AudioStream>List of streams containing audio only
subtitles: Vec<Subtitle>List of subtitles
expires_in_seconds: u32Lifetime of the stream URLs in seconds
Note: use the valid_until value to check if the stream URLs are still valid,
since it takes PO token lifetime into account.
valid_until: OffsetDateTimeDate until which the stream URLs are valid
hls_manifest_url: Option<String>HLS manifest URL (for livestreams)
dash_manifest_url: Option<String>Dash manifest URL (for livestreams)
preview_frames: Vec<Frameset>Video frames for seek preview
drm: Option<VideoPlayerDrm>Video player DRM config
None if the video is not DRM-protected
client_type: ClientTypeClient type with which the player was fetched
visitor_data: Option<String>YouTube visitor data ID
Implementations§
Source§impl VideoPlayer
impl VideoPlayer
Sourcepub fn select_audio_stream(&self, filter: &StreamFilter) -> Option<&AudioStream>
pub fn select_audio_stream(&self, filter: &StreamFilter) -> Option<&AudioStream>
Select the audio stream which is the best match for the given StreamFilter
Sourcepub fn select_video_stream(&self, filter: &StreamFilter) -> Option<&VideoStream>
pub fn select_video_stream(&self, filter: &StreamFilter) -> Option<&VideoStream>
Select the video stream which is the best match for the given StreamFilter
Sourcepub fn select_video_only_stream(
&self,
filter: &StreamFilter,
) -> Option<&VideoStream>
pub fn select_video_only_stream( &self, filter: &StreamFilter, ) -> Option<&VideoStream>
Select the video-only stream which is the best match for the given StreamFilter
Sourcepub fn select_video_audio_stream(
&self,
filter: &StreamFilter,
) -> (Option<&VideoStream>, Option<&AudioStream>)
pub fn select_video_audio_stream( &self, filter: &StreamFilter, ) -> (Option<&VideoStream>, Option<&AudioStream>)
Select a video and audio stream which is the best match for the given StreamFilter
Trait Implementations§
Source§impl Clone for VideoPlayer
impl Clone for VideoPlayer
Source§fn clone(&self) -> VideoPlayer
fn clone(&self) -> VideoPlayer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more