blob: 37554c8f07886287dc3eb16a150bda3d05271f68 [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>
var addtrackEventCount = 0;
function trackAdded(event)
{
consoleWrite("EVENT(" + event.type + ")");
compareTracks("event.track", "video.audioTracks[" + addtrackEventCount + "]");
++addtrackEventCount;
consoleWrite("");
}
function compareTracks(track1, track2)
{
var equal = (eval(track1) == eval(track2));
reportExpected(equal, track1, "==", track2, track1);
}
function canplaythrough()
{
consoleWrite("<br><i>** Check initial in-band track states<" + "/i>");
testExpected("video.audioTracks.length", 1);
consoleWrite("<br><i>** Unload video file, check track count<" + "/i>");
run("video.src = ''");
testExpected("video.audioTracks.length", 0);
consoleWrite("");
endTest();
}
function setup()
{
findMediaElement();
video.audioTracks.addEventListener("addtrack", trackAdded);
video.src = findMediaFile('audio', '../content/silence');
waitForEvent('canplaythrough', canplaythrough);
}
</script>
</head>
<body onload="setup()">
<video controls></video>
<p>In-band audio tracks.</p>
</body>
</html>