4 <p>Test that the audio element supports M4A files.</p>
6 <audio controls></audio>
8 <script src=video-test.js></script>
10 var timeupdateEventCount = 0;
11 mediaElement = document.getElementsByTagName('audio')[0];
13 mediaElement.addEventListener('error', function() {
14 consoleWrite("<span style='color:red'>FAIL</span> : caught 'error' event, audio.error = " + mediaElement.error.code);
18 mediaElement.addEventListener('canplaythrough', function() {
19 consoleWrite("EVENT(canplaythrough)");
20 testExpected("mediaElement.currentTime", 0);
26 ++timeupdateEventCount;
28 // wait 2 timeupdate events so we are sure the media engine is
30 if (timeupdateEventCount == 2) {
31 // make sure time is advancing
32 testExpected("mediaElement.currentTime", 0, '>');
33 // reset the counter to prevent infinite loop if the
34 // test is re-executed manually.
35 timeupdateEventCount = 0;
40 mediaElement.addEventListener("timeupdate", timeupdate);
43 mediaElement.src = "content/silence.m4a";