I've found some strange behaviour on Youtube videos added throughout the API.
On a particular site (videos are owned by the site and doesn't have any restrictions) the generated iframe displays the "video not available", from time to time, when the video loads or when the user starts playing it.
Checking at the iframe src seems fine, reloading that iframe solves the issue and even refreshing the page makes the video play without issues.
It's also curious because it doesn't happen everytime, using a private navigation to open the same URL sometimes it triggers the error while some others it doesn't.
I've tried to search everywhere but without any luck, I can't find anyone else with the same issue.
Here are some links, which probably opening them will trigger at least the issue once:
https://www.trumpetteacher.ch/fr/catalogue/31-frere-jacques-a-la-ferme.html
https://www.trumpetteacher.ch/fr/les-minouteries/38-caramel.html
https://www.trumpetteacher.ch/fr/si-on-swinguait/48-et-si-on-swinguait.html
https://www.trumpetteacher.ch/fr/consonances/63-badineries-sur-une-musique-de-philip-sparke.html
This is the code used to build the video:
videos[element] = new YT.Player(element, {
height: height,
width: width,
videoId: id,
host: yt_priv ? 'https://www.youtube-nocookie.com' : 'https://www.youtube.com',
origin: location.protocol + '//' + location.hostname,
playerVars: options,
});
the JS vars width, height are to set up the video dimensions while yt_priv is a boolean to choose between the enhanced privacy from Youtube or not
options does contain the following variables:
Thanks
var options = {
autoplay: autoplay,
controls: yt_cont,
loop: yt_loop,
modestbranding: 1,
rel: yt_rel,
showinfo: 0,
mute: yt_mute,
};
All the variables values are either 0 or 1
Any suggestion would be kindly appreciated. Thanks!