0

I've got a page with a bunch of youtube iframes embedded. I'd like to stop all videos on the page from playing.

I have no control over the embed code, so I can't access the frames by id or class (although I can access them by referring to their parent div).

The iframes have not been embedded using the youtube API, so I can't use that either.

bob
  • 753
  • 4
  • 15
  • 27
  • Have you tried to add `?rel=0` at the end of youtube video url? – Arun Kumar Sep 19 '18 at 07:29
  • Are you saying you legit have no control over the code whatsoever? Are you able to alter the code in any way at all? It would be super easy by following the steps in the answer(s) to this question: https://stackoverflow.com/questions/15164942/stop-embedded-youtube-iframe – Martin Sep 19 '18 at 07:29
  • In any case, if you have control over the parent div, you could choose to reload the contents within that div. That should stop the videos from playing as well. This is also assuming you can make some AJAX solution concerning all that where you load in your embeds into the div. – Martin Sep 19 '18 at 07:30
  • I have control over the code on the page with the exception of the iframe code. So I can control all markup around the iframe, but I have no control over the iframe markup. – bob Sep 19 '18 at 07:32
  • Are you able to construct some AJAX logic including the iframe markup, so that you can load in the iframes dynamically? My idea is generally that if you refresh the specified content (the iframes in your case) it should stop the video(s) from playing. – Martin Sep 19 '18 at 07:41
  • The problem with a reloading the iframes is that it it janky. The user can see the videos being refreshed. It's disruptive. – bob Sep 19 '18 at 08:09

0 Answers0