W
W
Web Lizard2016-11-01 12:08:43
YouTube
Web Lizard, 2016-11-01 12:08:43

How to stop playing YouTube video in pop-up after closing it?

Is there any simple and not steamy way to stop the video in the pop-up after it is closed?
Videos are inserted in the simplest way, ie. like this

<iframe class="youtube-video" width="100%" height="400" src="https://www.youtube.com/embed/ym80poNoDFE" frameborder="0" allowfullscreen></iframe>

Yes, I know that there is an api, and that you can upload each video through this api, but it's long and complicated. And there are already a lot of vidos on the site and it’s not an option to contact each vidos through id in order to close it.
Maybe there is some kind, even a crutch solution?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ivan Korsakov, 2016-11-01
@Lizard-108

Jquery:$('.video-block iframe').attr('src', '');

Z
Zam_Bo, 2016-11-01
@Zam_Bo

Here is the solution https://css-tricks.com/play-button-youtube-and-vim...

M
Maxim Sofronov, 2016-11-01
@maxsof

Try another modal window plugin like Cardboardbox . There is nothing to add, the video itself stops playing after closing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question