开发者

using QuickTime/JavaScript API in a HTML5 video tag

开发者 https://www.devze.com 2023-03-21 03:10 出处:网络
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.

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消