Search code examples
javascriptjqueryyoutube

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?


Solution

  • from the API docs:

    player.stopVideo()
    

    so in jQuery:

    $('#playerID').get(0).stopVideo();