I am basically trying to open a new tab in the Safari iPhone Mobile Browser (iOS 7) when the user clicks the "Done" button in the Native video player. This is the action flow:
- User Plays HTML5 Video (Clicks the Play Icon)
- Mobile Safari Opens Fullscreen Player 3 User Clicks Done
I tried various approaches and none of these events are working.
- ended
- webkitendfullscreen
- pause
Any ideas on on what may be a suitable solution? If you want to check out the work I have done so far here is the code and the JSFiddle Link: http://jsfiddle.net/r8bRE/
<script>
var myVideo = document.getElementById("nVideo");
myVideo.addEventListener("pause", function() {
window.open("http://www.google.com", "_blank");
window.focus();
}, false);
myVideo.addEventListener('webkitendfullscreen', function() {
window.open("http://www.google.com", "_blank");
window.focus();
}, false);
</script>