blob: c62d67fe55e25bed6934cef47c2f58655dfebd8e [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 changedEventCount = 0;
var track1;
var track2;
function trackChanged(event)
{
++changedEventCount;
if (changedEventCount > 1) {
testExpected("track1.selected", false);
testExpected("track2.selected", true);
testExpected("video.videoTracks.selectedIndex", 1);
endTest();
}
}
function canplaythrough()
{
testExpected("video.videoTracks.length", 2);
run("track1 = video.videoTracks[0]");
run("track2 = video.videoTracks[1]");
consoleWrite("<br><i>** Checking initial state</i>");
testExpected("track1.selected", true);
testExpected("track2.selected", false);
testExpected("video.videoTracks.selectedIndex", 0);
consoleWrite("<br><i>** If we select one track, the other should be deselected</i>");
video.videoTracks.addEventListener("change", trackChanged);
run("track2.selected = true");
}
function setup()
{
findMediaElement();
video.src = '../../content/two-audio-and-video-tracks.mkv';
waitForEvent('canplaythrough', canplaythrough);
}
</script>
</head>
<body onload="setup()">
<video controls></video>
<p>Test audio track enabled attributes.</p>
</body>
</html>