mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
MediaSession show media controls on Android
This commit is contained in:
parent
761f21fc8b
commit
dd63ba425f
11 changed files with 183 additions and 26 deletions
|
@ -224,9 +224,9 @@ pub struct MediaMetadata {
|
|||
pub enum MediaSessionPlaybackState {
|
||||
/// The browsing context does not specify whether it’s playing or paused.
|
||||
None_ = 1,
|
||||
/// The browsing context has paused media and it can be resumed.
|
||||
Playing,
|
||||
/// The browsing context is currently playing media and it can be paused.
|
||||
Playing,
|
||||
/// The browsing context has paused media and it can be resumed.
|
||||
Paused,
|
||||
}
|
||||
|
||||
|
|
|
@ -1804,9 +1804,15 @@ impl HTMLMediaElement {
|
|||
PlaybackState::Playing => {
|
||||
media_session_playback_state = MediaSessionPlaybackState::Playing;
|
||||
},
|
||||
PlaybackState::Buffering => {
|
||||
// Do not send the media session playback state change event
|
||||
// in this case as a None_ state is expected to clean up the
|
||||
// session.
|
||||
return;
|
||||
},
|
||||
_ => {},
|
||||
};
|
||||
println!(
|
||||
debug!(
|
||||
"Sending media session event playback state changed to {:?}",
|
||||
media_session_playback_state
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue