pub struct PlayerControlProxy { /* private fields */ }Implementations§
Source§impl PlayerControlProxy
impl PlayerControlProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.media.sessions2/PlayerControl.
Sourcepub fn take_event_stream(&self) -> PlayerControlEventStream
pub fn take_event_stream(&self) -> PlayerControlEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn play(&self) -> Result<(), Error>
pub fn play(&self) -> Result<(), Error>
Plays media. If this method is not supported as indicated by the absence of the PLAY
flag in PlayerCapabilities, this method does nothing.
Sourcepub fn pause(&self) -> Result<(), Error>
pub fn pause(&self) -> Result<(), Error>
Pauses playback and retains position in media. If this method is not supported as indicated
by the absence of the PAUSE flag in PlayerCapabilities, this method does nothing.
Sourcepub fn seek(&self, position: i64) -> Result<(), Error>
pub fn seek(&self, position: i64) -> Result<(), Error>
Seeks to a specific position in media. Implementations are free to
enter an error state if the position is out of bounds. position
is an offset from the beginning of the media. If this method is not supported as indicated
by the absence of the SEEK flag in PlayerCapabilities, this method does nothing.
Sourcepub fn skip_forward(&self) -> Result<(), Error>
pub fn skip_forward(&self) -> Result<(), Error>
Skips forward in media by the player’s default skip amount. If this method is not supported
as indicated by the absence of the SKIP_FORWARD flag in PlayerCapabilities, this method
does nothing.
Sourcepub fn skip_reverse(&self) -> Result<(), Error>
pub fn skip_reverse(&self) -> Result<(), Error>
Skips in reverse in media by the player’s default skip amount. If this method is not
supported as indicated by the absence of the SKIP_REVERSE flag in PlayerCapabilities,
this method does nothing.
Sourcepub fn next_item(&self) -> Result<(), Error>
pub fn next_item(&self) -> Result<(), Error>
Changes media to the next item (e.g. next song in playlist). If this method is not
supported as indicated by the absence of the CHANGE_TO_NEXT_ITEM flag in
PlayerCapabilities, this method does nothing.
Sourcepub fn prev_item(&self) -> Result<(), Error>
pub fn prev_item(&self) -> Result<(), Error>
Changes media to the previous item. If this method is not
supported as indicated by the absence of the CHANGE_TO_PREV_ITEM flag in
PlayerCapabilities, this method does nothing.
Sourcepub fn set_playback_rate(&self, playback_rate: f32) -> Result<(), Error>
pub fn set_playback_rate(&self, playback_rate: f32) -> Result<(), Error>
Sets the playback rate of the media. This will not change the playback mode. If this method
is not supported as indicated by the absense of the SET_PLAYBACK_RATE flag in
PlayerCapabilities, this method does nothing.
Sourcepub fn set_repeat_mode(&self, repeat_mode: RepeatMode) -> Result<(), Error>
pub fn set_repeat_mode(&self, repeat_mode: RepeatMode) -> Result<(), Error>
Sets repeat mode to any of the supported repeat modes.
Whether this method takes effect depends on the PlayerCapabilities and repeat_mode:
- [
OFF] is always supported. - [
GROUP] requires theREPEAT_GROUPScapability, and is otherwise ignored. - [
SINGLE] requires theREPEAT_SINGLEcapability, and is otherwise ignored.
Sourcepub fn set_shuffle_mode(&self, shuffle_on: bool) -> Result<(), Error>
pub fn set_shuffle_mode(&self, shuffle_on: bool) -> Result<(), Error>
Sets shuffle mode. If this method is not supported as indicated by the absence of the
SHUFFLE flag in PlayerCapabilities, this method does nothing.
Sourcepub fn bind_volume_control(
&self,
volume_control_request: ServerEnd<VolumeControlMarker>,
) -> Result<(), Error>
pub fn bind_volume_control( &self, volume_control_request: ServerEnd<VolumeControlMarker>, ) -> Result<(), Error>
Binds to the session’s volume control for control and notifications. If this method is not
supported as indicated by the absence of the HAS_GAIN_CONTROL flag in
PlayerCapabilities, the channel handle passed as volume_control_request is closed
by the service.
Trait Implementations§
Source§impl Clone for PlayerControlProxy
impl Clone for PlayerControlProxy
Source§fn clone(&self) -> PlayerControlProxy
fn clone(&self) -> PlayerControlProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PlayerControlProxy
impl Debug for PlayerControlProxy
Source§impl PlayerControlProxyInterface for PlayerControlProxy
impl PlayerControlProxyInterface for PlayerControlProxy
fn play(&self) -> Result<(), Error>
fn pause(&self) -> Result<(), Error>
fn stop(&self) -> Result<(), Error>
fn seek(&self, position: i64) -> Result<(), Error>
fn skip_forward(&self) -> Result<(), Error>
fn skip_reverse(&self) -> Result<(), Error>
fn next_item(&self) -> Result<(), Error>
fn prev_item(&self) -> Result<(), Error>
fn set_playback_rate(&self, playback_rate: f32) -> Result<(), Error>
fn set_repeat_mode(&self, repeat_mode: RepeatMode) -> Result<(), Error>
fn set_shuffle_mode(&self, shuffle_on: bool) -> Result<(), Error>
fn bind_volume_control( &self, volume_control_request: ServerEnd<VolumeControlMarker>, ) -> Result<(), Error>
Source§impl Proxy for PlayerControlProxy
impl Proxy for PlayerControlProxy
Source§type Protocol = PlayerControlMarker
type Protocol = PlayerControlMarker
Proxy controls.