Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop a youtube video with jquery?

I have a jquery slider that I have built, basically just three pannels that slide by applying negative left CSS values. Works great, but I have a youtube video in one slide that wont stop when I slide. I've tried display:none and Visibility:hidden which works in all but IE, the audio keeps going in IE.

Is there an easy way to kill a video with jquery?

like image 906
wesbos Avatar asked Jan 24 '10 19:01

wesbos


1 Answers

This solution is simple, elegant and works in all browsers:

var video = $("#playerid").attr("src"); $("#playerid").attr("src",""); $("#playerid").attr("src",video); 
like image 161
HeyTiger Avatar answered Sep 21 '22 14:09

HeyTiger