Jarallax video doesnt work on phone
Saku241 opened this issue · comments
Issue description:
Hello, I'm using jarallax to have a background video from youtube and the video works on browser (but I have to mute the sound for the autoplay) BUT it doesnt work on any phone. Actually it shows youtube controllers ui with a loading wheel and never play.
After some tweak I was able to make it work but the video played with sound...
Code to reproduce the issue (HTML blocks + JavaScript initialization)
<div id="started-video-bg" class="video-bg media-bg jarallax-video video-mobile-bg" data-jarallax data-video-src="https://youtu.be/ab0TSkLe-E0" data-video-volume="0">
<div class="video-bg-mask"></div>
<div class="video-bg-texture" id="grained_container"></div>
</div>
EDIT :
It works when putting this extra script : (So this is for sure a volume problem but I dont get it since I already put the data parameter "data-video-volume="0" ....
<div id="started-video-bg" class="video-bg media-bg jarallax-video video-mobile-bg" data-jarallax data-video-src="https://youtu.be/ab0TSkLe-E0" data-video-volume="0">
<div class="video-bg-mask"></div>
<div class="video-bg-texture" id="grained_container"></div>
</div>
<script>
document.addEventListener("DOMContentLoaded", function() {
jarallax(document.querySelectorAll('.jarallax-video'), {
videoVolume: 0,
});
});
</script>