3 <title>Test of 'played' attribute</title>
4 <script src=media-file.js></script>
5 <script src=video-test.js></script>
6 <script src=video-played.js></script>
14 ResetToAnEmptyVideoSource
17 // NOTE: Result details are not printed for this test because time values are different from machine
18 // to machine and run to run. Commenting out the following line turns on detailed logging back on, which
19 // can be useful for debugging test failure.
20 disableFullTestDetailsPrinting();
22 function PlayWithNoRanges()
24 consoleWrite("<br><b><em>Test playing when there are no ranges</em></b>");
26 timeRangeCount = currentTimeRange = 0;
27 willPauseInExistingRange = false;
28 willExtendAnExistingRange = false;
30 startPlayingInNewRange();
33 function ResetToAVideoSource()
35 consoleWrite("<br><b><em>Test to reset to non empty video source</em></b>");
37 timeRangeCount = currentTimeRange = 0;
38 expectedStartTimes = new Array();
39 expectedEndTimes = new Array();
41 willPauseInExistingRange = false;
42 willExtendAnExistingRange = false;
44 var mediaFile = findMediaFile("video", "content/test");
45 runSilently("video.src = \"" + mediaFile + "\"");
46 run("video.load()"); // Triggers canplay()
49 function JumpAndPlayFwd()
51 consoleWrite("<br><b><em>Test jumping forward into a new range and play</em></b>");
53 var newTime = video.duration - 0.5;
54 runSilently("video.currentTime = " + (newTime.toFixed(2)));
56 willPauseInExistingRange = false;
57 willExtendAnExistingRange = false;
60 startPlayingInNewRange();
63 function ResetToAnEmptyVideoSource()
65 consoleWrite("<br><b><em>Test to reset to an empty video source</em></b>");
67 willPauseInExistingRange = false;
68 willExtendAnExistingRange = false;
69 timeRangeCount = currentTimeRange = 0;
71 expectedStartTimes = new Array();
72 expectedEndTimes = new Array();
74 run("video.src = \"\"");
75 waitForEvent("loadstart", function () { testRanges(); nextTest(); });
76 run("video.load()"); // Triggers loadstart()
81 <body onload="videoPlayedMain()">
83 <video controls></video>
84 <p>Test of the media element 'played' attribute</p>