| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src="../video-test.js"></script> |
| <script src="../media-file.js"></script> |
| <script type="text/javascript"> |
| var session; |
| |
| function runTest() |
| { |
| findMediaElement(); |
| session = new MediaSession("content"); |
| |
| consoleWrite("Waiting for Content media to begin playing.") |
| video.src = findMediaFile("video", "../content/counting"); |
| video.session = session; |
| video.onplaying = beganPlaying; |
| video.oncanplaythrough = canplaythrough; |
| } |
| |
| function canplaythrough() |
| { |
| video.play(); |
| } |
| |
| function beganPlaying(event) |
| { |
| consoleWrite("Media began playing."); |
| video.onpause = paused; |
| |
| if (window.internals) { |
| testExpected('internals.mediaSessionCurrentState(session)', "active"); |
| |
| consoleWrite("Sending 'Content' start-of-interruption notification."); |
| run('internals.sendMediaSessionStartOfInterruptionNotification("content")'); |
| } |
| } |
| |
| function paused(event) |
| { |
| consoleWrite("The media element was paused."); |
| |
| if (window.internals) |
| testExpected('internals.mediaSessionCurrentState(session)', "idle"); |
| |
| endTest(); |
| } |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <p>'Content' start of interruption events should indefinitely pause 'Content' media sessions.</p> |
| <video id="video" controls> </video> |
| </body> |
| </html> |