title: Play embedded YouTube video in modal popup?
body: <p>Is it possible to have a YouTube video which has been embedded on a website, play in a modal popup when the user clicks on it?</p>
  
  <p>The videos are embedded using the embed code from YouTube, here an example:</p>
  
  <pre><code>&lt;iframe width="560" height="315" src="https://www.youtube.com/embed/iRYDYrj3Bfw" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>I have looked at several scripts which load YouTube videos into modal popups, such as this one: <a href="https://appleple.github.io/modal-video/" rel="nofollow noreferrer">https://appleple.github.io/modal-video/</a> </p>
  
  <p>But all of them so far do it with buttons or banners. </p>
  
  <p>I was hoping it would be as easy as doing something like this:</p>
  
  <pre><code>&lt;div id="wrapper"&gt;
  &lt;youtube iframe&gt;&lt;/iframe&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Then in javascript listen for a click on #wrapper ? </p>
  
  <p>I would like to emulate the behavior of the following website (you may need to scroll down to the section called "Arbeiten" and click on one of the videos): <a href="http://www.heimat.wien/#arbeiten" rel="nofollow noreferrer">http://www.heimat.wien/#arbeiten</a> </p>