mirror of
https://github.com/servo/servo.git
synced 2025-06-08 08:33:26 +00:00
Send MediaSessionAction from Android
This commit is contained in:
parent
b494acbf19
commit
08f9f17ed3
10 changed files with 64 additions and 15 deletions
|
@ -1087,3 +1087,20 @@ pub enum MediaSessionActionType {
|
|||
/// The action intent is to move the playback time to a specific time.
|
||||
SeekTo,
|
||||
}
|
||||
|
||||
impl From<i32> for MediaSessionActionType {
|
||||
fn from(value: i32) -> MediaSessionActionType {
|
||||
match value {
|
||||
1 => MediaSessionActionType::Play,
|
||||
2 => MediaSessionActionType::Pause,
|
||||
3 => MediaSessionActionType::SeekBackward,
|
||||
4 => MediaSessionActionType::SeekForward,
|
||||
5 => MediaSessionActionType::PreviousTrack,
|
||||
6 => MediaSessionActionType::NextTrack,
|
||||
7 => MediaSessionActionType::SkipAd,
|
||||
8 => MediaSessionActionType::Stop,
|
||||
9 => MediaSessionActionType::SeekTo,
|
||||
_ => panic!("Unknown MediaSessionActionType"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue