简体   繁体   中英

using QuickTime/JavaScript API in a HTML5 video tag

Im building an HTML5 webapp using 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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM