Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0
halfbird

Playing background video

Question

Hello, I'm using the Encore template, which won't allow me to play background video on every page of our website (thelab.org). For the code injection I'm using the below code, which seems to work for me on Chrome, Safari, and Firefox, but won't autoplay for other users on other computers. Any ideas on how to get this to play across the board?

  window.onload = function() {
    var iframe = document.createElement('iframe');
    iframe.id = "bg_video"
    iframe.style.cssText = "border:none;width:100vw;height:100vh;position:fixed;top:0px;left:0px;z-index:1;";
    iframe.src = "https://player.vimeo.com/video/362211620?autoplay=1&width=100" ;
    document.body.appendChild(iframe);
    resizeIframe();
    window.onresize = resizeIframe;
    var wrap = document.getElementById('outerWrapper');
    wrap.style.zIndex = '2';
};

 

Thank you for any help you can provide!

Share this post


Link to post

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...