mirror of
https://github.com/servo/servo
synced 2026-04-30 19:37:43 +02:00
html: Update MediaSession setPositionState method (#40793)
The MediaSession `setPositionState` method should only update the
position state and propagate it to the platform media session UI
controller and shouldn't change somehow the properties of the media
element directly (duration, playback rate or position).
See
https://w3c.github.io/mediasession/#dom-mediasession-setpositionstate
Testing: Improvements in the following tests
- /mediasession/positionstate.html
The media session UI functionality is implemented for Android and didn't
test due lack of testing sample.
Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
This commit is contained in:
@@ -2844,18 +2844,6 @@ impl HTMLMediaElement {
|
||||
media_session.send_event(event);
|
||||
}
|
||||
|
||||
pub(crate) fn set_duration(&self, duration: f64) {
|
||||
self.duration.set(duration);
|
||||
}
|
||||
|
||||
pub(crate) fn reset(&self) {
|
||||
if let Some(ref player) = *self.player.borrow() {
|
||||
if let Err(err) = player.lock().unwrap().stop() {
|
||||
error!("Could not stop player {:?}", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#concept-media-load-resource>
|
||||
pub(crate) fn origin_is_clean(&self) -> bool {
|
||||
// Step 5.local (media provider object).
|
||||
|
||||
Reference in New Issue
Block a user