summaryrefslogtreecommitdiffstats
path: root/dom/media/mediasource/test/test_MultipleInitSegments.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/media/mediasource/test/test_MultipleInitSegments.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/media/mediasource/test/test_MultipleInitSegments.html')
-rw-r--r--dom/media/mediasource/test/test_MultipleInitSegments.html53
1 files changed, 53 insertions, 0 deletions
diff --git a/dom/media/mediasource/test/test_MultipleInitSegments.html b/dom/media/mediasource/test/test_MultipleInitSegments.html
new file mode 100644
index 000000000..d97d72dae
--- /dev/null
+++ b/dom/media/mediasource/test/test_MultipleInitSegments.html
@@ -0,0 +1,53 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=windows-1252">
+ <title>MSE: Append buffer with multiple init segments</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, v) {
+ ms.addEventListener("sourceopen", function () {
+ var sb = ms.addSourceBuffer("video/webm");
+ fetchWithXHR("seek_lowres.webm", function (seek_lowres) {
+ fetchWithXHR("seek.webm", function (seek) {
+ var data = [
+ [seek_lowres, 0, 438], // lowres init segment
+ [seek_lowres, 438, 25950], // lowres media segment 0-1
+ [seek, 0, 318], // init segment
+ [seek, 46712, 67833] // media segment 0.8-1.201
+ ];
+ var length = data.map(d => d[2] - d[1]).reduce((a, b) => a + b);
+ var arrayBuffer = new Uint8Array(length);
+ var pos = 0;
+ data.forEach(function(d) {
+ var buffer = new Uint8Array(d[0], d[1], d[2]-d[1]);
+ arrayBuffer.set(buffer, pos);
+ pos += buffer.byteLength;
+ });
+ loadSegment.bind(null, sb, arrayBuffer)().then(function() {
+ // Since we are passing multiple segments in one buffer,
+ // the first durationchange event from parsing the init
+ // segment will be fired before updateend.
+ v.addEventListener("durationchange", function () {
+ ok(v.duration, 1.201);
+ SimpleTest.finish();
+ });
+ ms.endOfStream();
+ });
+ });
+ });
+ });
+});
+
+</script>
+</pre>
+</body>
+</html>