blob: b3c3bcd02199bf5bd37485d64cc22929cf0234ad [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script>
var timeout;
function go() {
var video = document.getElementsByTagName('video')[0];
video.play().then(playing).catch(notPlaying);
}
function playing() {
try {
window.webkit.messageHandlers.testHandler.postMessage('playing');
} catch(e) {
window.location = 'callback:playing';
}
}
function paused() {
try {
window.webkit.messageHandlers.testHandler.postMessage('paused');
} catch(e) { }
}
function notPlaying() {
try {
window.webkit.messageHandlers.testHandler.postMessage('not playing');
} catch(e) { }
}
</script>
</head>
<body onload="go()">
<video src="video-with-audio.mp4" webkit-playsinline></video>
</body>
</html>