Alexander
Alexander

Reputation: 367

youtube-iframe-api shows Video unavailable for some videos inside iframe

For the project purposes, we implemented a youtube player inside the iframe inside out application and it worked for a long period (at least the last 2 years). And now we are facing with an issue for playing some of the videos: enter image description here

I followed these instructions https://developers.google.com/youtube/iframe_api_reference to create prototypes with working and not working youtube player

  1. Video with Hebrew title in video - https://www.youtube.com/watch?v=Y-_XAt1OFNI https://www.w3schools.com/code/tryit.asp?filename=GU3ERZR46STN

It is not working

If we put the script out of iframe - it works well https://www.w3schools.com/code/tryit.asp?filename=GU3FFVDKFWQR

  1. Video with English title in video https://www.youtube.com/watch?v=vE1kg4R47N0

https://www.w3schools.com/code/tryit.asp?filename=GU3EP4UAIPJE

And it is working well inside the iframe

Upvotes: 1

Views: 1229

Answers (1)

Steven Day
Steven Day

Reputation: 11

I just ran into this issue on a site I'm building with CodeIgniter 4. Some videos play, some show "Video unavailable". It started when I enabled the secure headers filter.. Traced the problem to the Referrer-Policy, so I changed that from 'same-origin' to 'strict-origin-when-cross-origin', and now the unavailable videos play just fine.

Upvotes: 1

Related Questions