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

iframe youtube video control

iframe youtube video control



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 :


than i can play the youtube video ...

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


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(){; **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 .


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.



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

Problem courtesy of: Pierre Debroux


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


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