dom/media/mediasource/test/test_ChangeWhileWaitingOnMissingData_mp4.html
author Jean-Yves Avenard <jyavenard@mozilla.com>
Wed, 08 Mar 2017 00:28:13 +1100
changeset 498742 2b7cc2b452988668b40056b81ce33f39ed9afb66
child 795475 36dea7a1a4195b0faccf8762e83c63575008b379
child 795796 b6a5d4157b1f9db40da044e01ece54c379f4c678
child 795908 f84d23f114c3767dfeec77438bd5c4b9239ecc2b
child 796322 dfd548f6dbf2e9f4cf4a807a63fedfc7896e6854
child 797540 61fdaec9fd4fee6b4984542ce1e27109546757b6
permissions -rw-r--r--
Bug 1342913: P1. Add mochitest. r=gerald MozReview-Commit-ID: IaU4tIm0Wze

<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
  <title>MSE: resume from waiting even after format change occurred</title>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <script type="text/javascript" src="mediasource.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<pre id="test"><script class="testbody" type="text/javascript">

SimpleTest.waitForExplicitFinish();

runWithMSE(function(ms, el) {
  el.controls = true;
  once(ms, 'sourceopen').then(function() {
    ok(true, "Receive a sourceopen event");
    var sb = ms.addSourceBuffer("video/mp4");
    fetchAndLoad(sb, 'bipbop/bipbop_480_624kbps-video', ['init'], '.mp4')
    .then(fetchAndLoad.bind(null, sb, 'bipbop/bipbop_480_624kbps-video', range(1, 3), '.m4s'))
    .then(function() {
      el.play();
      // let seek to the last audio frame.
      // The seek will complete and then playback will stall.
      el.currentTime = 1.532517;
      return Promise.all([once(el, 'seeked'), once(el, 'stalled')]);
    })
    .then(function() {
      info("seek completed");
      return fetchAndLoad(sb, 'bipbop/bipbop', ['init'], '.mp4');
    })
    .then(fetchAndLoad.bind(null, sb, 'bipbop/bipbop', range(1, 4), '.m4s'))
    .then(function() {
      ms.endOfStream();
      return once(el, 'ended');
    }).then(function() {
      SimpleTest.finish();
    });
  });
});

</script>
</pre>
</body>
</html>