views:

67

answers:

2

Hi

I have a video playing on my page. I want to show and hide some div's when the video reaches a certain point. Lets say hide something on 10th second and show it again on 20th second.

I can easily do it in HTML5 with video tag and currentTime attribute but for IE I have to create the same functionality and I think with flash based videos (from YouTube or something like that).

Is there a way to detect the current time of a video playing on my website, embeded from YouTube, Metacafe or any other video sharing site?

I know I could detect it in flash and make it run some JavaScript function but I don't have flash nor have the skills to do it in AS3.

Is it possible to do it from JavaScript level or does any video sharing website out there provides this kind of functionality for their videos?

+2  A: 

You could look into using flowplayer, it exposes events for meta data and timing.

Sean Kinsey
nice! is it possible to read the actual time of a playing vid from js?
dome
@dome Oh this is perfect. Thank you.@Sean on this page http://flowplayer.org/demos/events/index.html look for `onCuepoint` in JS code.
6bytes
A: 

You can use ExternalInterface to communicate between flash and js. So inside the flash app, when the video reaches the defined time, you can trigger a call to js function, doing whatever you need with the divs.

Since you will need to receive a stream and you need to detect a specific point in the video I thing you have read this inside flash.

dome