I tried to include a Youtube video on a HTML page using the official "embed" code provided by Youtube and got an error Video not available, watch on youtube
when displaying the page containing the given code:
<iframe width="560" height="315" src="https://www.youtube.com/embed/ngywWphI7tk" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
A minimal working example with 2 embedded videos, the first not working and the second one working:
<p>Test</p>
<iframe width="662" height="408" src="https://www.youtube.com/embed/ngywWphI7tk" title="Set Me on Fire" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/ZyDO4rMbSQA" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
I found that another website successfully embedded the video I failed to embed: https://www.musicme.com/Pendulum/videos/Set-Me-On-Fire-6E6779775770684937746B.html with following code:
<iframe width="662" height="408" src="https://www.youtube.com/embed/ngywWphI7tk" title="Set Me on Fire" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
And even when I used directly this code (only difference was about dimensions), it failed on my side.
What can be the reason? How could I fix it? My current lead is that they might load it through JS so may interact with youtube API?