<html> | |
<head> | |
<script> | |
function pageLoaded() { | |
document.getElementById("video").play().then(function() { | |
window.parent.postMessage('autoplayed', '*'); | |
}).catch(function() { | |
window.parent.postMessage('did-not-play', '*'); | |
}); | |
} | |
function videoDidPause() { | |
window.parent.postMessage('on-pause', '*'); | |
} | |
</script> | |
</head> | |
<body onload="pageLoaded()"> | |
<video id="video" onpause=videoDidPause() playsinline src="test.mp4" /> | |
</body> | |
</html> |