mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
Auto merge of #27530 - jdm:media, r=Manishearth
Fix crashes on video playback in UWP - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #27529 and fix #27526 - [x] These changes do not require tests because there's no way to test UWP right now.
This commit is contained in:
commit
776b564db1
8 changed files with 61 additions and 27 deletions
|
@ -20,7 +20,7 @@ use crate::dom::bindings::str::DOMString;
|
|||
use crate::dom::htmlmediaelement::HTMLMediaElement;
|
||||
use crate::dom::mediametadata::MediaMetadata;
|
||||
use crate::dom::window::Window;
|
||||
use crate::realms::{AlreadyInRealm, InRealm};
|
||||
use crate::realms::{enter_realm, InRealm};
|
||||
use dom_struct::dom_struct;
|
||||
use embedder_traits::MediaMetadata as EmbedderMediaMetadata;
|
||||
use embedder_traits::MediaSessionEvent;
|
||||
|
@ -80,8 +80,8 @@ impl MediaSession {
|
|||
if let Some(media) = self.media_instance.get() {
|
||||
match action {
|
||||
MediaSessionActionType::Play => {
|
||||
let in_realm_proof = AlreadyInRealm::assert(&self.global());
|
||||
media.Play(InRealm::Already(&in_realm_proof));
|
||||
let realm = enter_realm(self);
|
||||
media.Play(InRealm::Entered(&realm));
|
||||
},
|
||||
MediaSessionActionType::Pause => {
|
||||
media.Pause();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue