Bug 1524065 - part2 : use browsing context to resume delayed autoplay media. r=farre
authoralwu <alwu@mozilla.com>
Tue, 19 Mar 2019 18:45:36 +0000
changeset 465165 94f8d2ce7f8cacdf1db59508436a084b6b80d2b8
parent 465164 f884c612401ec2ea39ebfd5206c5d082360fa9bb
child 465166 bc864bb5cd2bfa0f6b76eba69ee2cbc07d39643a
push id35732
push useropoprus@mozilla.com
push dateWed, 20 Mar 2019 10:52:37 +0000
treeherdermozilla-central@708979f9c3f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfarre
bugs1524065
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1524065 - part2 : use browsing context to resume delayed autoplay media. r=farre Replace the current way and use the new way in order to make this working well after enable Fission. Differential Revision: https://phabricator.services.mozilla.com/D18137
toolkit/content/widgets/browser-custom-element.js
--- a/toolkit/content/widgets/browser-custom-element.js
+++ b/toolkit/content/widgets/browser-custom-element.js
@@ -996,17 +996,17 @@ class MozBrowser extends MozElementMixin
     this.messageManager.sendAsyncMessage("AudioPlayback", { type: suspendedReason });
   }
 
   stopMedia() {
     this.messageManager.sendAsyncMessage("AudioPlayback", { type: "mediaControlStopped" });
   }
 
   resumeMedia() {
-    this.messageManager.sendAsyncMessage("AudioPlayback", { type: "resumeMedia" });
+    this.frameLoader.browsingContext.notifyStartDelayedAutoplayMedia();
     if (this._hasAnyPlayingMediaBeenBlocked) {
       this._hasAnyPlayingMediaBeenBlocked = false;
       let event = document.createEvent("Events");
       event.initEvent("DOMAudioPlaybackBlockStopped", true, false);
       this.dispatchEvent(event);
     }
   }