Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

iframe youtube video control

iframe youtube video control

Problem

hi,

i m really new to javascript and html5(just started 3 weeks ago) so my questions will maybe look a bit stupid.

So i would like to know if it s posible to stop a Youtube video with a mouseleave.function...

i ve a Music wich play on my website, when i rollover my youtube video the music stop , i did it like this :

$(video).mouseenter(function(){
    audioElement.pause();
});

than i can play the youtube video ...

when i leave the video player the music goes on again , i use this :

$(video).mouseleave(function(){
    audioElement.play();
});

But i would like to make the youtube video stop at the same time because the sound of the video is playing while the sound on my background music is playing...

$(video).mouseleave(function(){
    audioElement.play(); **Something here to pause the youbevideo**
});

Is it possible? i would like to keep the version of the youtube video because i use fitvids to resize my videos .

Thanks

Pierre srry for my english...

Here is the solution for me, RAVI.

So the Solution was to move the YouYube API script from the external js to the main html.

http://users.skynet.be/fc864408/version9.html

    

      

now it works... the video is resizing according to the window.

Problem courtesy of: Pierre Debroux

Solution

Just use (VideoElementID).play() and (VideoElementID).pause() to play/pause the video on mouse events. You don't need to play/pause audio and video separately.

Regards, Ravi

Solution courtesy of: Ravi Trivedi

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

iframe youtube video control

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×