summaryrefslogtreecommitdiffstats
path: root/dom/base/test/file_pluginAudioNonAutoStart.html
blob: 5a5c9e0c26edd2633b4b0e4bf3a6193c3dd7fc23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html>
<embed type="application/x-test" width="200" height="200"></embed>
<script>
var plugin = document.querySelector("embed");

function startAudio() {
  plugin.startAudioPlayback();
}

function stopAudio() {
  plugin.stopAudioPlayback();
}

function pluginMuted() {
  return plugin.audioMuted();
}

function toggleMuteState(muted) {
  var Ci = SpecialPowers.Ci;
  var utils = SpecialPowers.wrap(window).top
                           .QueryInterface(Ci.nsIInterfaceRequestor)
                           .getInterface(Ci.nsIDOMWindowUtils);
  utils.audioMuted = muted;
}
</script>