summaryrefslogtreecommitdiffstats
path: root/dom/media/test/crashtests/media-element-source-seek-1.html
blob: 5c3aed5ae7ca3b15587510c808c92798095b2a90 (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
26
27
<!DOCTYPE html>
<html class="reftest-wait">
<script>
var audioElement = document.createElement("audio");
audioElement.autoplay = true;
audioElement.src = "sound.ogg";
audioElement.onplaying =
  function() {
    audioElement.onplaying = null;
    setTimeout(
      function() {
        audioElement.onseeked =
          function() {
            // Note we reset 'src' to release decoder resources and cubeb
            // streams to prevent OOM or OpenCubeb() failures.
            audioElement.src = "";
            document.documentElement.removeAttribute("class");
          };
        audioElement.currentTime = 0;
      }, 100);
  };

var context = new window.AudioContext();
var source = context.createMediaElementSource(audioElement);
source.connect(context.destination);
</script>
</html>