pub struct Video {
pub id: usize,
pub title: String,
pub album: Option<String>,
pub size: usize,
pub duration: usize,
pub media_type: String,
/* private fields */
}
Fields
id: usize
title: String
album: Option<String>
size: usize
duration: usize
media_type: String
Implementations
sourceimpl Video
impl Video
pub fn get(client: &Client, id: usize) -> Result<Video>
pub fn list(client: &Client) -> Result<Vec<Video>>
pub fn info<'a, S>(&self, client: &Client, format: S) -> Result<VideoInfo>where
S: Into<Option<&'a str>>,
sourcepub fn captions<'a, S>(&self, client: &Client, format: S) -> Result<String>where
S: Into<Option<&'a str>>,
pub fn captions<'a, S>(&self, client: &Client, format: S) -> Result<String>where
S: Into<Option<&'a str>>,
Returns the raw video captions.
sourcepub fn set_size(&mut self, width: usize, height: usize)
pub fn set_size(&mut self, width: usize, height: usize)
Sets the size that the video will stream at, measured in pixels.
sourcepub fn set_start_time(&mut self, offset: usize)
pub fn set_start_time(&mut self, offset: usize)
Sets the time (in seconds) that a stream will be offset by.
For example, to start playback at 1:40, use an offset of 100 seconds.
Can be used to implement video skipping.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Video
impl<'de> Deserialize<'de> for Video
sourcefn deserialize<D>(de: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(de: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Media for Video
impl Media for Video
sourcefn has_cover_art(&self) -> bool
fn has_cover_art(&self) -> bool
Returns whether or not the media has an associated cover.
sourcefn cover_id(&self) -> Option<&str>
fn cover_id(&self) -> Option<&str>
Returns the cover ID associated with the media, if any. Read more
sourceimpl Streamable for Video
impl Streamable for Video
sourcefn stream(&self, client: &Client) -> Result<Vec<u8>>
fn stream(&self, client: &Client) -> Result<Vec<u8>>
Returns the raw bytes of the media. Read more
sourcefn stream_url(&self, client: &Client) -> Result<String>
fn stream_url(&self, client: &Client) -> Result<String>
Returns a constructed URL for streaming. Read more
sourcefn download(&self, client: &Client) -> Result<Vec<u8>>
fn download(&self, client: &Client) -> Result<Vec<u8>>
Returns the raw bytes of the media. Read more
sourcefn download_url(&self, client: &Client) -> Result<String>
fn download_url(&self, client: &Client) -> Result<String>
Returns a constructed URL for downloading the song.
sourcefn set_max_bit_rate(&mut self, bit_rate: usize)
fn set_max_bit_rate(&mut self, bit_rate: usize)
Sets the maximum bitrate the media will use when streaming. Read more
sourcefn set_transcoding(&mut self, format: &str)
fn set_transcoding(&mut self, format: &str)
Sets the transcoding format the media will use when streaming. Read more
Auto Trait Implementations
impl RefUnwindSafe for Video
impl Send for Video
impl Sync for Video
impl Unpin for Video
impl UnwindSafe for Video
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more