| <html> |
| <head> |
| <script> |
| function pageLoaded() { |
| try { |
| window.webkit.messageHandlers.testHandler.postMessage("loaded"); |
| } catch(e) { } |
| } |
| |
| function beganPlaying() { |
| try { |
| window.webkit.messageHandlers.testHandler.postMessage("played"); |
| } catch(e) { } |
| } |
| |
| function play() { |
| let video = document.getElementById("video"); |
| video.playbackRate = 5; // Speeds up the test. |
| video.play(); |
| } |
| </script> |
| </head> |
| <body onload="pageLoaded()"> |
| <button id="playButton" onclick="play()">Play</button> |
| <br /> |
| <video controls id="video" onplaying="beganPlaying()" src="long-test.mp4"></video> |
| </body> |
| </html> |