pub trait PlayerTrait {
Show 20 methods
// Required methods
fn add_and_play<'life0, 'life1, 'async_trait>(
&'life0 mut self,
track: &'life1 Track,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn volume(&self) -> Volume;
fn set_volume(&mut self, volume: Volume) -> Volume;
fn pause(&mut self);
fn resume(&mut self);
fn is_paused(&self) -> bool;
fn seek(&mut self, secs: i64) -> Result<()>;
fn seek_to(&mut self, position: Duration);
fn get_progress(&self) -> Option<PlayerProgress>;
fn set_speed(&mut self, speed: Speed) -> Speed;
fn speed(&self) -> Speed;
fn stop(&mut self);
fn gapless(&self) -> bool;
fn set_gapless(&mut self, to: bool);
fn skip_one(&mut self);
fn enqueue_next(&mut self, track: &Track);
fn media_info(&self) -> MediaInfo;
// Provided methods
fn add_volume(&mut self, volume: VolumeSigned) -> Volume { ... }
fn add_speed(&mut self, speed: SpeedSigned) -> Speed { ... }
fn position(&self) -> Option<PlayerTimeUnit> { ... }
}Required Methods§
Sourcefn add_and_play<'life0, 'life1, 'async_trait>(
&'life0 mut self,
track: &'life1 Track,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_and_play<'life0, 'life1, 'async_trait>(
&'life0 mut self,
track: &'life1 Track,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Add the given track, skip to it (if not already) and start playing
Sourcefn set_volume(&mut self, volume: Volume) -> Volume
fn set_volume(&mut self, volume: Volume) -> Volume
Set the volume to a specific amount.
Returns the new volume
fn pause(&mut self)
fn resume(&mut self)
fn is_paused(&self) -> bool
Sourcefn seek(&mut self, secs: i64) -> Result<()>
fn seek(&mut self, secs: i64) -> Result<()>
Seek relatively to the current time
§Errors
Depending on different backend, there could be different errors during seek.
Sourcefn get_progress(&self) -> Option<PlayerProgress>
fn get_progress(&self) -> Option<PlayerProgress>
Get current track time position
Sourcefn set_speed(&mut self, speed: Speed) -> Speed
fn set_speed(&mut self, speed: Speed) -> Speed
Set the speed to a specific amount.
Returns the new speed
fn stop(&mut self)
fn gapless(&self) -> bool
fn set_gapless(&mut self, to: bool)
fn skip_one(&mut self)
Sourcefn enqueue_next(&mut self, track: &Track)
fn enqueue_next(&mut self, track: &Track)
Add the given URI to be played, but do not skip currently playing track
Sourcefn media_info(&self) -> MediaInfo
fn media_info(&self) -> MediaInfo
Get info of the current media
Provided Methods§
Sourcefn add_volume(&mut self, volume: VolumeSigned) -> Volume
fn add_volume(&mut self, volume: VolumeSigned) -> Volume
Add a relative amount to the current volume
Returns the new volume
Sourcefn add_speed(&mut self, speed: SpeedSigned) -> Speed
fn add_speed(&mut self, speed: SpeedSigned) -> Speed
Add a relative amount to the current speed
Returns the new speed
Sourcefn position(&self) -> Option<PlayerTimeUnit>
fn position(&self) -> Option<PlayerTimeUnit>
Quickly access the position.
This should ALWAYS match up with PlayerTrait::get_progress’s .position!