title: Why does YouTube Player API show "This video is unavailable." when playing certain videos?
body: <p>I am testing out some simple HTML5 code in order to play embedded YouTube videos in a browser. However, some videos (almost exclusively music videos) will not play in the browser. Instead, a error message stating "This video is unavailable appears" <a href="https://i.stack.imgur.com/Fl5RA.png" rel="nofollow noreferrer">(as shown here)</a>.</p>
  
  <p>This is the HTML code used to display the video:</p>
  
  <pre><code>&lt;iframe width="560" height="315" src="https://www.youtube.com/embed/oGpFcHTxjZs" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>which is the exact code generated by YouTube when selecting their "Embed" option.</p>
  
  <p>The iframe tag does work for some videos, however, as shown here:</p>
  
  <pre><code>&lt;iframe width="560" height="315" src="https://www.youtube.com/embed/jxvPjuREDpE" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>What is strange is that all types of embedded videos seem to work in an environment such as jsfiddle, but not when loading a separate HTML file into a browser. </p>
  
  <p>A similar issue was asked here: <a href="https://stackoverflow.com/questions/51316379/this-video-is-unavailable-when-putting-music-videos-in-iframe">&quot;This video is unavailable&quot; when putting music videos in iFrame</a> , but is only resolved by running an http server, which is a completely new topic to me. </p>
  
  <p>Does anyone know of an HTML/javscript fix to this issue? Thanks in advance. </p>