<html> | |
<head> | |
<script> | |
function pageLoaded() { | |
var video = document.getElementById("video"); | |
video.volume = 0; | |
video.play().then(function() { | |
try { | |
window.webkit.messageHandlers.testHandler.postMessage("autoplayed"); | |
} catch(e) { } | |
}).catch(function() { | |
try { | |
window.webkit.messageHandlers.testHandler.postMessage("did-not-play"); | |
} catch(e) { } | |
}); | |
} | |
</script> | |
</head> | |
<body onload="pageLoaded()"> | |
<video id="video" playsinline src="test.mp4" /> | |
</body> | |
</html> |