简体   繁体   中英

Is it possible to interact with an embed movie via javascript?

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 would 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 ?

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.

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 .

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