Jump to content

How to stop video in tabs?

Viriathus's Photo
Posted Nov 06 2012 02:05 PM
2926 Views

I have a tab interface on my website that contains images and a youtube video on the last tab. All works fine however everytime I switch tabs the video doesn't stop playing. Is there a way to fix this? Thanks in advance.

This is what I got:

http://jsfiddle.net/EPEDr/1/

Tags:
1 Subscribe


2 Replies

0
  rachel.j's Photo
Posted Nov 07 2012 08:48 AM

You can call a function when switching tabs to stop or pause the video using the YouTube player API. Check out the API docs at https://developers.g...ence#pauseVideo and this example on the YouTube dev blog.

Also, here are two good conversations on StackOverflow about this:
http://stackoverflow...ding-the-iframe
http://stackoverflow...-api-stop-video

Hope that helps!

Rachel
0
  rachel424's Photo
Posted Jun 30 2013 08:07 PM

i think you can just close your website and you may stop the video.