implement MediaSession.setPositionState method

This commit is contained in:
Shinichi Morimoto 2019-11-27 15:17:24 +09:00
parent 83bb96740d
commit 274d4d2303
3 changed files with 78 additions and 2 deletions

View file

@ -1925,6 +1925,18 @@ impl HTMLMediaElement {
media_session.send_event(event);
}
pub fn set_duration(&self, duration: f64) {
self.duration.set(duration);
}
pub fn reset(&self) {
if let Some(ref player) = *self.player.borrow() {
if let Err(e) = player.lock().unwrap().stop() {
eprintln!("Could not stop player {:?}", e);
}
}
}
}
// XXX Placeholder for [https://github.com/servo/servo/issues/22293]