I am embedding a movie in a web page with the embed tag, but I would like to interact and be interacted via javascript with the embedded movie in .mov. In particular, I wou开发者_开发问答ld like to get the timings so I can perform actions on the web pages when a particular moment in the movie is reached (like adding subtitles or karaoke effects in the page as the movie plays).
Is this possible with standard HTML 4 and javascript, or do I need flash or maybe html 5 ?
Applies only to embedded flash content - post was made before OP clarified that he was using mov
files.
Yes it is - provided you have access to the source code of the flash movie. Interaction between Flash movie and the javascript is done through ExternalInterface - check out the call()
and addCallback()
methods in that page.
As for getting the timings, you can use playheadTime property of the video player control. You might also want to check out the cue points - FLV player dispatches cuePoint events when the play head reaches cue points set at the time of creating the FLV.
You can Listen to these events and call appropriate javascript functions using ExternalInterface
.
You most certainly can do this, I've done this with MOVs on a major project. Refer to this page for all you need to know.
精彩评论