blob: a69989cf5fd3e8a7f234457438237894ae3f4f04 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src=../../media-file.js></script>
<script src=../../video-test.js></script>
<script>
// testArraysEqual() is way too slow to use here
function testDataCue(cueStr, expected)
{
try {
var success = true;
var cue = eval(cueStr);
var data = new Uint8Array(cue.data);
testExpected("new Uint8Array(" + cueStr + ".data).length", expected.length);
for (var i = 0; i < data.length; ++i) {
if (data[i] != expected[i]) {
reportExpected(false, "new Uint8Array(" + cueStr + ".data)[" + i + "]", "==", expected[i], data[i]);
success = false;
}
}
reportExpected(success, "new Uint8Array(" + cueStr + ".data)", "==", "[" + expected.join(", ") + "]", "See above");
} catch (e) {
logResult(false, "Testing cue " + cueStr + " threw exception " + e);
}
}
function start()
{
findMediaElement();
run("track0 = video.textTracks[0]");
run("track0.mode = 'hidden'");
testExpected("track0.kind", "metadata");
testExpected("track0.id", "1770");
testExpected("track0.inBandMetadataTrackDispatchType", "C005044554");
run("cues0 = track0.cues");
testExpected("cues0.length", "2");
testDataCue("cues0[0]", [227, 64, 136, 251, 251, 0, 59, 176, 126, 0, 1, 193, 0, 0, 17, 3, 16, 2, 128, 0, 0, 1, 255, 0, 0, 105, 0, 0, 0, 1, 3, 216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 12, 1, 60, 59, 67, 97, 98, 108, 101, 108, 97, 98, 115, 95, 78, 97, 116, 105, 111, 110, 97, 108, 95, 101, 116, 118, 95, 115, 116, 114, 101, 97, 109, 95, 99, 111, 110, 102, 105, 103, 47, 109, 97, 105, 110, 97, 112, 112, 47, 49, 46, 48, 47, 109, 97, 105, 110, 95, 112, 114, 46, 112, 114, 0, 15, 14, 105, 98, 46, 116, 118, 119, 111, 114, 107, 115, 46, 99, 111, 109, 225, 54, 136, 221, 188, 252, 142, 137]);
testDataCue("cues0[1]", [228, 66, 49, 0, 1, 0, 60, 178, 39, 0, 1, 193, 0, 0, 17, 3, 16, 3, 0, 0, 0, 1, 255, 0, 2, 18, 0, 1, 1, 255, 0, 0, 69, 66, 73, 70, 4, 0, 1, 0, 0, 22, 11, 72, 207, 255, 0, 1, 254, 0, 1, 6, 0, 0, 248, 0, 0, 5, 1, 0, 0, 32, 2, 0, 0, 49, 0, 0, 0, 154, 4, 0, 0, 176, 3, 0, 0, 197, 0, 2, 0, 2, 0, 0, 0, 1, 255, 6, 2, 0, 0, 0, 111, 0, 171, 0, 16, 0, 5, 0, 0, 0, 4, 255, 10, 2, 0, 0, 9, 1, 0, 2, 9, 1, 0, 3, 9, 1, 0, 4, 128, 0, 0, 0, 0, 255, 255, 18, 18, 18, 255, 255, 153, 153, 153, 255, 255, 204, 204, 204, 255, 255, 181, 151, 29, 255, 255, 51, 51, 51, 127, 0, 17, 17, 17, 230, 255, 153, 153, 153, 230, 255, 204, 204, 204, 230, 255, 181, 151, 29, 230, 255, 51, 51, 51, 255, 255, 16, 16, 147, 255, 255, 158, 11, 14, 255, 255, 16, 147, 16, 255, 255, 102, 45, 145, 255, 255, 239, 106, 16, 0, 1, 0, 5, 0, 0, 0, 2, 255, 14, 3, 0, 0, 5, 2, 0, 3, 0, 0, 33, 0, 0, 0, 1, 0, 4, 0, 0, 0, 2, 255, 6, 2, 0, 0, 10, 2, 0, 2, 0, 101, 255, 255, 0, 4, 0, 7, 0, 0, 0, 7, 255, 9, 1, 0, 0, 9, 1, 0, 1, 9, 1, 0, 2, 9, 1, 0, 3, 9, 1, 0, 4, 9, 1, 0, 5, 9, 1, 0, 6, 8, 7, 0, 0, 187, 255, 255, 0, 7, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 8, 7, 0, 0, 189, 255, 255, 0, 1, 50, 0, 0, 6, 4, 15, 0, 4, 1, 2, 1, 15, 6, 6, 6, 6, 6, 255, 250, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 32, 255, 15, 2, 1, 3, 3, 3, 15, 2, 2, 2, 2, 2, 16, 0, 0, 255, 250, 255, 250, 255, 250, 255, 250, 0, 0, 0, 0, 0, 255, 196, 255, 212, 255, 200, 255, 228, 255, 200, 255, 240, 255, 251, 0, 0, 15, 1, 1, 1, 1, 1, 255, 174, 0, 0, 255, 250, 255, 206, 255, 250, 255, 218, 255, 229, 0, 0, 112, 255, 255, 0, 1, 0, 0, 33, 19, 31, 1, 31, 255, 255, 255, 208, 0, 0, 0, 0, 2, 192, 1, 224, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 255, 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 100, 0, 13, 187, 160, 10, 15, 0, 0, 255, 170, 0, 100, 1, 44, 2, 38, 0, 27, 0, 3, 0, 0, 0, 57, 84, 104, 105, 115, 32, 105, 115, 32, 97, 32, 67, 97, 98, 108, 101, 108, 97, 98, 115, 32, 110, 97, 116, 105, 111, 110, 97, 108, 32, 69, 84, 86, 32, 65, 100, 32, 99, 114, 101, 97, 116, 101, 100, 32, 102, 114, 111, 109, 32, 84, 86, 87, 111, 114, 107, 115, 46, 189, 105, 252, 26, 5, 216, 230, 95]);
consoleWrite("");
run("track1 = video.textTracks[1]");
run("track1.mode = 'hidden'");
testExpected("track1.kind", "metadata");
testExpected("track1.id", "1768");
testExpected("track1.inBandMetadataTrackDispatchType", "C005044554A2");
run("cues1 = track1.cues");
testExpected("cues1.length", "1");
testDataCue("cues1[0]", [224, 0, 114, 0, 0, 0, 3, 0, 0, 8, 0, 255, 255, 255, 0, 1, 0, 224, 94, 1, 1, 0, 0, 0, 0, 0, 0, 0, 100, 16, 82, 0, 80, 108, 105, 100, 58, 47, 47, 105, 98, 46, 116, 118, 119, 111, 114, 107, 115, 46, 99, 111, 109, 47, 67, 97, 98, 108, 101, 108, 97, 98, 115, 95, 78, 97, 116, 105, 111, 110, 97, 108, 95, 101, 116, 118, 95, 115, 116, 114, 101, 97, 109, 95, 99, 111, 110, 102, 105, 103, 47, 109, 97, 105, 110, 97, 112, 112, 47, 49, 46, 48, 47, 109, 97, 105, 110, 95, 112, 114, 46, 112, 114, 90, 3, 153, 38]);
consoleWrite("");
run("track2 = video.textTracks[2]");
run("track2.mode = 'hidden'");
testExpected("track2.kind", "metadata");
testExpected("track2.id", "45");
testExpected("track2.inBandMetadataTrackDispatchType", "86");
testExpected("track2.cues.length", "0");
consoleWrite("");
run("track3 = video.textTracks[3]");
run("track3.mode = 'hidden'");
testExpected("track3.kind", "metadata");
testExpected("track3.id", "36");
testExpected("track3.inBandMetadataTrackDispatchType", "81");
testExpected("track3.cues.length", "0");
consoleWrite("");
endTest();
}
</script>
</head>
<body>
<video src="../../content/user-private-streams.ts" oncanplaythrough="start()" controls></video>
<p>Check for metadata tracks from MPEG-TS file.</p>
</body>
</html>