Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I might have a solution for the video as background, stretched to the browser-width or height, (but the video will still preserve the aspect ratio, couldnt find a solution for that yet.):</p> <p>Put the video right after the body-tag with <code>style="width:100%;"</code>. Right afterwords, put a "bodydummy"-tag:</p> <pre><code>&lt;body&gt; &lt;video id="bgVideo" autoplay poster="videos/poster.png"&gt; &lt;source src="videos/test-h264-640x368-highqual-winff.mp4" type="video/mp4"/&gt; &lt;source src="videos/test-640x368-webmvp8-miro.webm" type="video/webm"/&gt; &lt;source src="videos/test-640x368-theora-miro.ogv" type="video/ogg"/&gt; &lt;/video&gt; &lt;img id="bgImg" src="videos/poster.png" /&gt; &lt;!-- This image stretches exactly to the browser width/height and lies behind the video--&gt; &lt;div id="bodyDummy"&gt; </code></pre> <p>Put all your content inside the <code>bodydummy</code>-div and put the z-indexes correctly in CSS like this:</p> <pre><code>#bgImg{ position: absolute; top: 0; left: 0; border: 0; z-index: 1; width: 100%; height: 100%; } #bgVideo{ position: absolute; top: 0; left: 0; border: 0; z-index: 2; width: 100%; height: 100%; } #bodyDummy{ position: absolute; top: 0; left: 0; z-index: 3; overflow: auto; width: 100%; height: 100%; } </code></pre> <p>Hope I could help. Let me know when you could find a solution that the video does <strong>not</strong> maintain the aspect ratio, so it could fill the whole browser window so we do not have to put a bgimage.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload