summaryrefslogtreecommitdiffstats
path: root/dom/media/mediasource/test/test_trackidchange_mp4.html
blob: fdbeece3cd2e9769610e1d0a397c6a8d98683641 (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
<!DOCTYPE HTML>
<html>
<head>
  <title>MSE: test append of audio with similar init segments that have different track ids</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 audiosb = ms.addSourceBuffer("audio/mp4");
  await fetchAndLoad(audiosb, "init-trackid2", [''], ".mp4");
  await fetchAndLoad(audiosb, "segment-2.0001", [''], ".m4s");
  await fetchAndLoad(audiosb, "init-trackid3", [''], ".mp4");
  await fetchAndLoad(audiosb, "segment-3.0002", [''], ".m4s");
  is(el.buffered.length, 1, "data is buffered");
  is(el.buffered.end(0), 8, "all data got appended");
  SimpleTest.finish();
});

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