0
0
0348raven2015-10-22 10:11:32
JavaScript
0348raven, 2015-10-22 10:11:32

How to stop youtube video when another youtube video starts playing?

There is a slider with videos that are inserted into an iframe.
It is necessary to stop the already playing video when you turn on any other.
Tried like this

$('.video .slides li').change(function(){
    $('video').contentWindow.postMessage('{"event":"onclick","func":"pauseVideo","args":""}', '*');
  });

Did not help.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0348raven, 2015-10-23
@0348raven

Well, I decided to say it myself and in a different way, here is the reference .
Well, in general, a lot of useful information is written in the documentation for the API .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question