pub enum PlayerRequest {
Show 13 variants
Play {
control_handle: PlayerControlHandle,
},
Pause {
control_handle: PlayerControlHandle,
},
Stop {
control_handle: PlayerControlHandle,
},
Seek {
position: i64,
control_handle: PlayerControlHandle,
},
SkipForward {
control_handle: PlayerControlHandle,
},
SkipReverse {
control_handle: PlayerControlHandle,
},
NextItem {
control_handle: PlayerControlHandle,
},
PrevItem {
control_handle: PlayerControlHandle,
},
SetPlaybackRate {
playback_rate: f32,
control_handle: PlayerControlHandle,
},
SetRepeatMode {
repeat_mode: RepeatMode,
control_handle: PlayerControlHandle,
},
SetShuffleMode {
shuffle_on: bool,
control_handle: PlayerControlHandle,
},
BindVolumeControl {
volume_control_request: ServerEnd<VolumeControlMarker>,
control_handle: PlayerControlHandle,
},
WatchInfoChange {
responder: PlayerWatchInfoChangeResponder,
},
}Expand description
Player is a handle for a media player. Unsupported commands are
no-ops. Consult PlaybackCapabilities, sent by to learn which
commands are supported.
Variants§
Play
Plays media. If this method is not supported as indicated by the absence of the PLAY
flag in PlayerCapabilities, this method does nothing.
Fields
control_handle: PlayerControlHandlePause
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.
Fields
control_handle: PlayerControlHandleStop
Stops playback. The session should close.
Fields
control_handle: PlayerControlHandleSeek
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.
SkipForward
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.
Fields
control_handle: PlayerControlHandleSkipReverse
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.
Fields
control_handle: PlayerControlHandleNextItem
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.
Fields
control_handle: PlayerControlHandlePrevItem
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.
Fields
control_handle: PlayerControlHandleSetPlaybackRate
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.
SetRepeatMode
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.
SetShuffleMode
Sets shuffle mode. If this method is not supported as indicated by the absence of the
SHUFFLE flag in PlayerCapabilities, this method does nothing.
BindVolumeControl
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.
WatchInfoChange
Gets the net player info change using the hanging get pattern.
Fields
responder: PlayerWatchInfoChangeResponderImplementations§
Source§impl PlayerRequest
impl PlayerRequest
pub fn into_play(self) -> Option<PlayerControlHandle>
pub fn into_pause(self) -> Option<PlayerControlHandle>
pub fn into_stop(self) -> Option<PlayerControlHandle>
pub fn into_seek(self) -> Option<(i64, PlayerControlHandle)>
pub fn into_skip_forward(self) -> Option<PlayerControlHandle>
pub fn into_skip_reverse(self) -> Option<PlayerControlHandle>
pub fn into_next_item(self) -> Option<PlayerControlHandle>
pub fn into_prev_item(self) -> Option<PlayerControlHandle>
pub fn into_set_playback_rate(self) -> Option<(f32, PlayerControlHandle)>
pub fn into_set_repeat_mode(self) -> Option<(RepeatMode, PlayerControlHandle)>
pub fn into_set_shuffle_mode(self) -> Option<(bool, PlayerControlHandle)>
pub fn into_bind_volume_control( self, ) -> Option<(ServerEnd<VolumeControlMarker>, PlayerControlHandle)>
pub fn into_watch_info_change(self) -> Option<PlayerWatchInfoChangeResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL