I've recently "finished" a website, and it uses some transparent videos that move as you scroll the site. They work perfectly on Chrome because I used a VP9 codec through a transparent WebM container.
For Safari, I used an HEVC codec contained in a MOV. I encoded this video from an Apple Prores 4444 with Alpha codec to HEVC directly in Finder. This allowed me to preserve transparency in HEVC. When played on my Mac through Quicktime, it plays with no issues.
Additionally, I included a standard non-transparent H264 if any browser has a hard time with the two above.
However, as my question states, Safari does not display anything. Funnily enough, a month ago, when I was testing the website, it worked divinely on Safari. The HTML for the videos has not changed since that test.
To achieve this transparent video style, I followed this detailed tutorial. If you'd like to be more thorough and take a look at my website's code, you can also find it here. (Remember: The videos work on Chrome, but they don't appear in Safari.) To add to the weirdness, Firefox does display the videos, but only a freeze-frame. It does not play them when scrolling. Below I have attached screenshots of what I see in Safari and Firefox:
Safari:
The result after following the link (which, to be clear, works perfectly on my Mac. So I believe it is properly encoded. And it is also properly linked.)
All in all, I have no idea what's going on in Safari and Firefox. I feel like I've tried everything, and I've scoured the web for answers, to no avail. Thus I come to you for help. I hope we can figure this one out :)
Why won't Safari display these videos despite everything seeming to be correct? Why won't Firefox play them?
Thank you for your time.
PS: In case anyone is wondering, I got the videos to play while scrolling by following this classic example:
// select video element
var vid = document.getElementById('v0');
//var vid = $('#v0')[0]; // jquery option
// pause video on load
vid.pause();
// pause video on document scroll (stops autoplay once scroll started)
window.onscroll = function(){
vid.pause();
};
// refresh video frames on interval for smoother playback
setInterval(function(){
vid.currentTime = window.pageYOffset/400;
}, 40);
#set-height
display block
height 13500px
#v0
position fixed
top 0
left 0
width 100%
p font-family helvetica
font-size 24px
#set-height
p#time
video(id="v0", tabindex="0", autobuffer preload)
<source type="video/webm; codecs="vp8, vorbis"" src="https://www.html5rocks.com/tutorials/video/basics/Chrome_ImF.webm"></source>
<source type="video/ogg; codecs="theora, vorbis"" src="https://www.html5rocks.com/tutorials/video/basics/Chrome_ImF.ogv"></source>
<source type="video/mp4; codecs="avc1.42E01E, mp4a.40.2"" src="https://www.html5rocks.com/tutorials/video/basics/Chrome_ImF.mp4"></source>
p Sorry, your browser does not support the <video> element.