开发者

How to detect time on a playing Flash video

开发者 https://www.devze.com 2022-12-29 23:26 出处:网络
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 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?


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


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.

0

精彩评论

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