Jump to content

adding image at the end of vimeo video when video is stopped


sweetysweety

Recommended Posts

hi,
<div id="videoContent" style="display:none"></div>               <img src="imajlar/PlayerPlay.png" id="playerPic" style="margin-top:52px; margin-left:322px;"/>
my structure is like above.my jquery is:
$("#playerPic").on("click",function(){$("#videoContent").append('<iframe width="900" height="350" id="vimeo" src="http://player.vimeo.com/video/41763950?api=1&player_id=player&force_embed=1&server=vimeo.com&show_title=1&show_byline=1&show_portrait=1&color=00adef&fullscreen=1&autoplay=1&loop=0" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowfullscreen></iframe>');$("#playerPic").hide();$("iframe#vimeo").remove();$("#playerPic").show(); });
i'm trying to do that when video is stopped or paused,the image that i identified before will take place above the video.actually when video is stopped or paused,iframe should be hidden and image should be seen.how can i do this?
Link to comment
Share on other sites

 

 

but apple did this.

Apple embedded a video from Vimeo in an iframe and they were able to use Javascript to detect when the video in that iframe ended? Why don't you just copy their code, then? Because as far as I know, you can't use Javascript to interact with a page from a different domain inside an iframe. If you know better than I do then I would like to see an example though.

Link to comment
Share on other sites

Maybe your code is wrong, but as a rule you cannot use Javascript to interact with content inside an iframe that is on another domain. If the page inside the iframe is on your domain then Javascript can work with it, but Javascript will not be able to interact with a page that is on vimeo.com. That means that Javascript on your site will not be able to tell when the video ends.

Link to comment
Share on other sites

 

 

maybe i can count seconds of video and append image after that seconds.

You can use a timer to replace the element after a certain amount of time, but that's not going to guarantee that they watched the video. Maybe they had it paused, or maybe it took a while for the video to start.

Link to comment
Share on other sites

Why can't you delete the iframe and insert an image?

 

http://www.w3schools.com/jsref/met_node_replacechild.asp

 

I'm guessing the jQuery equivalent might be...

 

http://api.jquery.com/replaceWith/

cause i have to use vimeo video.

my main purpose is to show video.

but when video is ended,a black screen appearing and it looks not good for some people.

that's why i want to put image at the end of video.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...