Embeded YouTube video not available in iframe HTML

YouTube forbids embedding some videos in a localhost environment without a public domain, but your video can be embedded with no issue through a public domain/ sub-domain try the same using webhosting apps or online html tools.


If you're unable to see the video on the JSFiddle link that MrBean provided, then there is something wrong with your device, rather than the embed itself.

If that's the case, isolating the problem is the next step.

Have you tried:

  1. A different browser. (Perhaps there's a problem with one of your extensions, or your cache.)

  2. A different computer on the network. (Perhaps there's a problem with your security settings or firewall filter.)

  3. A different computer on a different network. (This will emulate most users, which have reported to be able to see the video correctly.)


It works perfectly. I tried embedding four different videos and all of them works well. Here is the link https://jsfiddle.net/Arpit09/kt1dwqjp/7/

<iframe width="100%" height="315" src="https://www.youtube.com/embed/KdbDDVcw7qc?rel=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

We had a very similar issue yet none of the standard approaches listed here and in other SO questions answered / solved our issue.

In our case, the issue was limited to videos that had License content typically Music Style videos from the well known artists.

The issue did not happen when the video was not licensed. I know some artists can flag that their videos are not shareable, and, domains can be allowed / blocked etc. However, we know that none of these related to us.

Instead the issue was the Referer Policy. I suspect Google / Youtube for licensed content builds a trust model, and part of that trust model expects a strong Referer policy.

We solved our issue by setting the Referer Policy MDN Refer Policy to a stronger referer policy.

If we used the the default:

'no-referrer-when-downgrade'

the video when played would say Video not available.

We changed to:

origin-when-cross-origin

the video played successfully