Merge mozilla-central to autoland. CLOSED TREE
[gecko.git] / toolkit / actors / AudioPlaybackChild.sys.mjs
bloba392a73464b68d506fb10ef733e462d04e8c513e
1 /* vim: set ts=2 sw=2 sts=2 et tw=80: */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 export class AudioPlaybackChild extends JSWindowActorChild {
7   observe(subject, topic, data) {
8     if (topic === "audio-playback") {
9       let name = "AudioPlayback:";
10       if (data === "activeMediaBlockStart") {
11         name += "ActiveMediaBlockStart";
12       } else if (data === "activeMediaBlockStop") {
13         name += "ActiveMediaBlockStop";
14       } else {
15         name += data === "active" ? "Start" : "Stop";
16       }
17       this.sendAsyncMessage(name);
18     }
19   }