Im building an HTML5 webapp u开发者_开发问答sing the new video tag. I use most of the new features but some of them are not implemented yet and I could use the old QT/JS API.
Apple provides documentation for that : http://developer.apple.com/library/safari/#documentation/QuickTime/Conceptual/QTScripting_JavaScript/bQTScripting_JavaScri_Document/QuickTimeandJavaScri.html#//apple_ref/doc/uid/TP40001526-CH001-SW5
but this is only vor object or embed tags. Do you know if there is a way to do it using the video tag ?
(the whole purpose of my request is to catch the event on iOS where the user can actually press play on a video)
If i understand you correctly that you want to catch the event when a user starts play on a HTML5 Video, you can use the following events:
videoElements = document.getElementsByTagName("video");
for (var i = 0; i < videoElements.length; i++) {
ele = videoElements[i];
ele.addEventListener("play", onVideoPlay);
ele.addEventListener("pause", onVideoPause);
ele.addEventListener("ended", onVideoEnded);
}
Or is it something else you want to achieve?
精彩评论