summaryrefslogtreecommitdiffstats
path: root/dom/media/mediasource/test/test_ChangeWhileWaitingOnMissingData_mp4.html
blob: b5889da560146d31f1c17fb3f1beff6cfa9df8be (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
28
29
30
31
32
33
34
35
36
37
<!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 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(async (ms, el) => {
  el.controls = true;
  await once(ms, "sourceopen");
  ok(true, "Receive a sourceopen event");
  const sb = ms.addSourceBuffer("video/mp4");
  await fetchAndLoad(sb, "bipbop/bipbop_480_624kbps-video", ["init"], ".mp4");
  await fetchAndLoad(sb, "bipbop/bipbop_480_624kbps-video", range(1, 3), ".m4s");
  el.play();
  // let seek to the last audio frame.
  // The seek will complete and then playback will stall.
  el.currentTime = 1.532517;
  await Promise.all([once(el, "seeked"), once(el, "waiting")]);
  info("seek completed");
  await fetchAndLoad(sb, "bipbop/bipbop", ["init"], ".mp4");
  await fetchAndLoad(sb, "bipbop/bipbop", range(1, 4), ".m4s");
  ms.endOfStream();
  await once(el, "ended");
  SimpleTest.finish();
});

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