My Youtube embed appears in Chrome and Firefox, but it doesn’t appear in Safari (which includes mobile Safari on the iPhone). I get the same result using Vimeo or native HTML5 video – nothing appears in this div. Here’s a 1-minute video that shows exactly what’s happening:
https://www.youtube.com/watch?v=YnqDlmYOKW8
I tried z-index
, position
, changing the width
and height
of the iFrame, changing https
to http
, removing encrypted-media
in the embed code, and so much more.
The website is https://waltrib.com/shop/ and the test product is "Heavy Dirt". I’m using a plugin called Booster WordPress that allows me to change product images into custom HTML (so I’m using it for Youtube embeds).
At 0:48 in the video above – what’s bizarre is that when I open the Developer Inspector and add anything like www
then the iFrame appears. Weird. When browsing in Safari, it renders Youtube embeds on every single page of the website, except for the /shop page.
I read this stackoverflow which suggests using object
but that didn’t work.
Has anything seen a bug like this? It’s one of the strangest things I’ve seen recently.
2
Answers
Instead of :
Use:
Sounds silly, but works.
Update:
It seems a change in URL of any kind refreshes the iframe and hence it appears so following would work:
Execute this code only after iframe is loaded. Use load handler for that.
Try adding parameters to iFrame src link:
More on my answer here.