pub struct PlayerSession { /* private fields */ }Expand description
Player session managing a single playback
Implementations§
Source§impl PlayerSession
impl PlayerSession
Sourcepub fn new(config: PlayerConfig) -> Self
pub fn new(config: PlayerConfig) -> Self
Create a new player session
Sourcepub async fn state(&self) -> PlayerState
pub async fn state(&self) -> PlayerState
Get current state
Sourcepub fn subscribe_state(&self) -> Receiver<PlayerState>
pub fn subscribe_state(&self) -> Receiver<PlayerState>
Subscribe to state changes
Sourcepub async fn current_rendition(&self) -> Option<Rendition>
pub async fn current_rendition(&self) -> Option<Rendition>
Get current rendition
Sourcepub async fn buffer_level(&self) -> f64
pub async fn buffer_level(&self) -> f64
Get buffer level
Sourcepub async fn metrics(&self) -> QualityMetrics
pub async fn metrics(&self) -> QualityMetrics
Get quality metrics
Sourcepub async fn buffered_ranges(&self) -> Vec<(f64, f64)>
pub async fn buffered_ranges(&self) -> Vec<(f64, f64)>
Get buffered ranges
Sourcepub async fn fetch_segment(&self, segment: &Segment) -> Result<Bytes>
pub async fn fetch_segment(&self, segment: &Segment) -> Result<Bytes>
Fetch next segment
Sourcepub async fn update_position(&self, position: f64)
pub async fn update_position(&self, position: f64)
Update playback position (called by renderer)
Sourcepub async fn report_dropped_frame(&self)
pub async fn report_dropped_frame(&self)
Report dropped frame
Sourcepub async fn report_decoded_frame(&self)
pub async fn report_decoded_frame(&self)
Report decoded frame
Auto Trait Implementations§
impl Freeze for PlayerSession
impl !RefUnwindSafe for PlayerSession
impl Send for PlayerSession
impl Sync for PlayerSession
impl Unpin for PlayerSession
impl UnsafeUnpin for PlayerSession
impl !UnwindSafe for PlayerSession
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