mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
libservo: Move Android MediaSessionAction
conversion to servoshell (#35225)
The conversion of an integer into a `MediaSessionAction` is Android-specific and thus shouldn't be used throughout the source code. This change moves the conversion to the Android port of servoshell. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
764feada30
commit
1aae7a441f
2 changed files with 15 additions and 18 deletions
|
@ -736,20 +736,3 @@ 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