html - Full screen HTML5 Video -
i've looked on , have not found great solution yet. trying implement full screen, responsive video. here specific structure of site.
fixed header
masthead - has full screen video
main - 5 sub sections, full screen
footer
so, masthead div contains text , video designed take 100% of width , height of screen. div needs responsive , scale page.
currently, have solution fills page, expands beyond height of page when gets wide, not ideal. have solution this?
i've looked @ "full screen background video" links, treat page background , fix video viewport, not needs happen here.
here code.
html
<div id="masthead"> <div class="masthead-intro"> <h1>we community good</h1> <h3>curabitur dignissim elemen tum ante pellentesque rhoncus.<br> viva muse rutrum felis id risus tris tique, ut congue orci.</h3> </div> <video src="/video/pcl_borndreamersshortform.mp4" poster="img/masthead-video.png" autoplay loop muted></video> </div>
and css
#masthead { margin-top: $baseline*3; position: relative; margin-bottom: $mobile-baseline*3; max-height: 100vh; @include respond-to-min($break-medium) { margin-bottom: $baseline*3; margin-top: 0; } video { position: absolute; top: 0; left: 0; min-height: 100%; width: 100%; height: auto; z-index: -100; overflow: hidden; } }
i not opposed jquery or javascript solution if has one.
it seems video expands beyond height of page since setting height auto , overrides previous height:100%
. doing other way around?
video { position: fixed; top: 0; left: 0; min-height: 100%; width: auto; z-index: -100; overflow: hidden; }
of course, have problem in displays width bigger height, there area not covered video. perhaps can edit 2 versions of video, 1 vertical , 1 horizontal displays , load appropriate 1 @media query in css or jquery.
Comments
Post a Comment