Hello! I am creating an iframe linked to a video that I created years ago in YouTube. I can open that link from many different application, phones, computers. Everything is ok. Except in Xway iframe which says “video unavailable. playback on other websites has been disabled by the user.”
I have tried modifying on/off back and forth Youtube parameters like Visibity and Embedded to no avail. The video is still fine and visible, but not to the iframe.
I am running out of ideas. Any idea where I should investigate further?
The issue likely stems from two areas. First, check your .htaccess file for restrictive headers like X-Frame-Options "SAMEORIGIN" or Referrer-Policy "same-origin" and comment them out or remove them, as they can block iframe embedding. Second, in YouTube Studio, ensure “Allow embedding” is enabled under the video’s advanced settings. Save the changes to confirm embedding permissions. Hope that helps.
The error means that embedding has been disabled or restricted for this video by the YouTube owner. If you are the owner, this should be something you can change on YouTube.
There is a YouTube article on restricting embedding here.
Having tried your YouTube link in an Xway test document, I found that I was unable to view it in a local preview, but it did work after I uploaded to a test site. This might mean that there is something in your YouTube settings that prevents the video from being viewed via a non-HTTPS protocol (local previews use the file:// protocol)
I verified your assumption that the file protocol was actually not supported by YT for some reason.
I solved my problem by creating a test http server under python and verifying that my local http request to YT worked.
FYI, I created a bunch of around 20 clips and some of them are supported only in http by YT, when all other clips are fine in either file and http. Why so in YT is a mystery…
It looks like this is a long-standing issue that inexplicably affects some videos and not others.
Seems to be that some videos allow embedding in any form, others need to be accessed via an HTTP server, others need an HTTP server and a hostname (not accessing using localhost or an IP address).