Trait servo_media_player::Player

source ·
pub trait Player: Send + MediaInstance {
Show 15 methods // Required methods fn play(&self) -> Result<(), PlayerError>; fn pause(&self) -> Result<(), PlayerError>; fn stop(&self) -> Result<(), PlayerError>; fn seek(&self, time: f64) -> Result<(), PlayerError>; fn set_mute(&self, val: bool) -> Result<(), PlayerError>; fn set_volume(&self, value: f64) -> Result<(), PlayerError>; fn set_input_size(&self, size: u64) -> Result<(), PlayerError>; fn set_rate(&self, rate: f64) -> Result<(), PlayerError>; fn push_data(&self, data: Vec<u8>) -> Result<(), PlayerError>; fn end_of_stream(&self) -> Result<(), PlayerError>; fn buffered(&self) -> Result<Vec<Range<f64>>, PlayerError>; fn set_stream( &self, stream: &MediaStreamId, only_stream: bool, ) -> Result<(), PlayerError>; fn render_use_gl(&self) -> bool; fn set_audio_track( &self, stream_index: i32, enabled: bool, ) -> Result<(), PlayerError>; fn set_video_track( &self, stream_index: i32, enabled: bool, ) -> Result<(), PlayerError>;
}

Required Methods§

source

fn play(&self) -> Result<(), PlayerError>

source

fn pause(&self) -> Result<(), PlayerError>

source

fn stop(&self) -> Result<(), PlayerError>

source

fn seek(&self, time: f64) -> Result<(), PlayerError>

source

fn set_mute(&self, val: bool) -> Result<(), PlayerError>

source

fn set_volume(&self, value: f64) -> Result<(), PlayerError>

source

fn set_input_size(&self, size: u64) -> Result<(), PlayerError>

source

fn set_rate(&self, rate: f64) -> Result<(), PlayerError>

source

fn push_data(&self, data: Vec<u8>) -> Result<(), PlayerError>

source

fn end_of_stream(&self) -> Result<(), PlayerError>

source

fn buffered(&self) -> Result<Vec<Range<f64>>, PlayerError>

Get the list of time ranges in seconds that have been buffered.

source

fn set_stream( &self, stream: &MediaStreamId, only_stream: bool, ) -> Result<(), PlayerError>

Set the stream to be played by the player. Only a single stream of the same type (audio or video) can be set. Subsequent calls with a stream of the same type will override the previously set stream. This method requires the player to be constructed with StreamType::Stream. It is important to give the correct value of only_stream indicating that the audio or video stream being set is the only one expected. Subsequent calls to set_stream after the only_stream flag has been set to true will fail.

source

fn render_use_gl(&self) -> bool

If player’s rendering draws using GL textures

source

fn set_audio_track( &self, stream_index: i32, enabled: bool, ) -> Result<(), PlayerError>

source

fn set_video_track( &self, stream_index: i32, enabled: bool, ) -> Result<(), PlayerError>

Implementors§