I can't get the container to correctly wrap around the video in firefox. Chrome and IE work fine. This is the site: http://www3.carleton.ca/clubs/sissa/html5/video.html
HTML:
<div id="video_container">
<video id="trailers" poster="poster.jpg">
<source src="vLast.mp4" type="video/mp4">
<source src="vLast.webm" type="video/webm">
</video>
<nav>
<div id="controls">
<button id="playButton">Play</button>
<div id="vol" onclick="showSlider()">Vol
<div id="containSlider">
<input type="range" id="vSlider" min="0" max="1" step="0.1" value="0.5"/>
</div>
</div>
<div id="defaultBar">
<div id="progressBar"></div>
</div>
<button id="mute">Mute</button>
<button id="full" onclick="toggleFullScreen()">Full</button>
</div>
<div id="playlist" class="animated fadeInRight">
<div class="thumb" id="tb1"><img src="TbGow.jpg" onClick="changeTrailer('vGow')"/></div>
<div class="thumb" id="tb2"><img src="TbLast.jpg" onClick="changeTrailer('vLast')"/></div>
<div class="thumb" id="tb3"><img src="TbTwo.jpg" onClick="changeTrailer('vTwo')"/></div>
</div>
</nav>
</div>
CSS:
#video_container{
-webkit-box-flex: 1;
-moz-box-flex: 1;
border:5px solid black;
margin: 20px;
padding: 0px;
width:100%;
height:100%;
position: relative;
background-color:white;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
#video_container video{
width: 100%;
height: auto;
display: block;
z-index: 9999;
}
FYI Mozilla Firefox is the only browser that still doesn't support flex-wrap. It supports inly single-line flexbox. (flex-wrap needs multi-line flexbox).
Feature Firefox (Gecko)
- Not supported
Chrome
- 21.0-webkit
Internet Explorer
- 10.0-moz
Opera
- full support 12.10
Maxthon
- full support 4.0
https://developer.mozilla.org/en-US/docs/CSS/flex-wrap
I am currently looking for solution...
Alright then Batman :)
Try this
<style>
#-moz-document url-prefix() {
#video_container{
min-height:1px;
max-height:1px;
}
}
</style>
Add this in your html document!
Try #-moz-document url-prefix(), which is a Gecko layout engine rule. Documentation can be found here. Enjoy.
Related
I am trying to set a background video to full screen.
I can achieve this with height: 100vh; and width: 100%; but as soon as the ratio changes from 16:9, I start to get whitespace.
I have also tried using object object-fit: cover; but this seems to overflow all over the place and I struggle to contain it. It also isn't as widely supported (I.E 11 and and edge 15 don't support it).
I'm not sure if I am complicating things using bootstrap 4 as well.
My HTML is layed out like so
<div class="container-fluid home-page">
<video playsinline autoplay muted loop poster="polina.jpg" id="bgvid">
<source src="/wp-content/themes/_underscores/assets/Placeholder-Video.mp4" type="video/mp4">
</video>
<div class="row clients">
<div class="client-slider col-12">
<?php foreach($clients as $key => $client) : ?>
<div class="client-logo" style="background-image: url(<?php echo $client->featured_image; ?>)"></div>
<?php endforeach; ?>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-12 info-text">
<h3>Title</h3>
<p>Content....</p>
SEE HOW IT WORKS
</div>
<div class="col-md-6 col-xs-12 backgroundg">
</div>
</div>
</div>
As soon as I position the video element, everything below it (i.e. .clients) float up to the top because the video element is taken out of the regular document flow. I can give .clients margin-top: 100vh; but then I need to give the video element object-fit: cover; and it floods the whole document as the background.
Just to give you an idea of my css (sass) so far:
video {
object-fit: cover;
width: 100vw;
height: 100vh;
z-index: 0;
position: absolute;
top: 0;
left: 0;
}
.clients{
margin-top: 100vh;
}
I have been looking at a couple of tutorials like https://slicejack.com/fullscreen-html5-video-background-css/ and http://thenewcode.com/777/Create-Fullscreen-HTML5-Page-Background-Video but I don't think in there example, they have content below the full screen video.
Thanks.
Ended up doing this:
HTML:
<div class="video-container">
<video playsinline autoplay muted loop poster="" id="bgvid">
<source src="/wp-content/themes/_quander/assets/QUANDER_PITCH_CUT_3.mp4" type="video/mp4">
</video>
</div>
<div class="container-fluid home-page">
<div class="row clients">
<div class="client-slider col-12">
<?php foreach($clients as $key => $client) : ?>
<div class="client-logo" style="background-image: url(<?php echo $client->featured_image; ?>)"></div>
<?php endforeach; ?>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-12 info-text">
<h3>Title</h3>
<p>Content....</p>
SEE HOW IT WORKS
</div>
<div class="col-md-6 col-xs-12 backgroundg">
</div>
</div>
</div>
css:
.video-container{
position: absolute;
width: 100%;
height: 100vh;
overflow: hidden;
video {
object-fit: cover;
width: 100vw;
height: 100vh;
position: absolute;
top: 0;
left: 0;
}
}
.home-page{
margin-top: 100vh;
}
So keeping the .home-page margin-top to 100vh stops the content riding up and overlapping the video.
The video is then dynamic (to the extent of being 100% vw and vh). Then having the overflow: hidden; on the .video-container stops the video flowing all over the page.
It is possible to add responsive video with the below code:
<div class="video_wrapper">
<video width="640" height="360" controls="" autoplay="">
<!-- MP4 must be first for iPad! -->
<source src="http://clips.vorwaerts-gmbh.de/VfE_html5.mp4" type="video/mp4">
<!-- Safari / iOS, IE9 -->
<source src="http://clips.vorwaerts-gmbh.de/VfE.webm" type="video/webm">
<!-- Chrome10+, Ffx4+, Opera10.6+ -->
<source src="http://clips.vorwaerts-gmbh.de/VfE.ogv" type="video/ogg">
<!-- Firefox3.6+ / Opera 10.5+ -->
</video>
</div>
.video_wrapper {
position: relative;
padding-bottom: 56.25%;
padding-top: 25px;
height: 0;
}
.video_wrapper video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
This should work for you. I have removed the padding from the container-fluid and used bootstrap class embed-responsive.
.home-page{
padding: 0 !important;
overflow: hidden;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css" rel="stylesheet"/>
<div class="container-fluid home-page">
<div class="embed-responsive embed-responsive-16by9">
<video playsinline autoplay muted loop poster="polina.jpg">
<source src="https://player.vimeo.com/external/158148793.hd.mp4?s=8e8741dbee251d5c35a759718d4b0976fbf38b6f&profile_id=119&oauth2_token_id=57447761" type="video/mp4">
</video>
</div>
<div class="row clients">
<div class="client-slider col-12">
<?php foreach($clients as $key => $client) : ?>
<div class="client-logo" style="background-image: url(<?php echo $client->featured_image; ?>)"></div>
<?php endforeach; ?>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-12 info-text">
<h3>Title</h3>
<p>Content....</p>
SEE HOW IT WORKS
</div>
<div class="col-md-6 col-xs-12 backgroundg">
</div>
</div>
</div>
I have created a custom video toolbar for displaying of video controls for HTML video tag.
i have positioned my custom toolbar to display over the video in full screen mode which displays correctly for Chrome but doesn't work for Firefox
HTML
<div class="wrapper-video">
<video id="player" data-setup="{}" class='video-js vjs-default-skin' width='635' height='432'>
<source src="" type="video/mp4">
</video>
<div class="playpause"></div>
</div>
<div class="info-video-title-bar">//Custom toolbar with video controls
<progress value="0" max="1000" id="lecture_progress_bar" class="time-tooltip">
<div class="progress-bar" id="progress-bar">
<span style="width: 0%;">Progress: 0%</span>
</div>
</progress>
<style>
</style>
<div class="audio-controls-container">
<span id="video-control-play" class="lecture-icon icon-WebFont-55"></span>
<span id="control-seek" class="lecture-icon icon-WebFont-57" onclick="mixpanel.track('Lecture Seek');"></span>
<span id="control-playback-rate" class="lecture-icon icon-WebFont-60">
</span>
<span class="icon-WebFont-77 full-screen">
</div>
</div>
JS
$(document).on('click', ".full-screen", function(){
if($(this).hasClass("icon-WebFont-77")){
$(".video-js")[0].player.requestFullscreen();
$(".info-video-title-bar").addClass("fixed");
$("progress").addClass("fixed-progress");
$(".audio-controls-container").addClass("fixed-controls");
$(".full-screen").removeClass("icon-WebFont-77").addClass("icon-WebFont-79");
}else if($(this).hasClass("icon-WebFont-79")){
exitFullScreen();
}
});
CSS
.fixed-progress{
width: 100% !important;
}
.fixed{
position: absolute;
z-index: 999999999999;
left: 0px;
line-height: 1px !important;
}
.fixed-controls{
max-width: 100%;
}
.video-js{
position: absolute;
}
.wrapper-video{
position: relative;
}
I know this question has been asked a number of times but for my problem the proposed solutions are not working.
I am presenting a PDF to a user in a modal along side a form. Image below.
The problem I am having is that the iframe is set at 100% for the maximum size it will go to at 100% is as per the image.
If I give is a fixed size of 435px; it sizes to the right aspect for my screen. As I need this to be screen agnostic I want it to size its self according to the modal that it appears in.
I have tried using the working example from here http://www.bootply.com/92230 and this example is the same as I have seen all over the web this morning.
The HTML for this is
<div class="row">
<div id="equalheight">
<div id="loa" class="col-md-6 demo NotShown">
<iframe src="\\sqlmuldvwsk06.ukskpre.santanderuk.pre.corp\Public\CMCFileUpload\LOAFiles\SRA557034_321043.004.pdf" class="mh100Percent mw100" frameborder="0" scrolling="no">
<p>It appears your web browser doesn't support iframes.</p>
</iframe>
</div>
<div id="custDetails" class="col-md-12 demo">
...
</div>
</div>
</div>
The reason I am having to use an iFrame is because I am working on an application that is for internal use on a corporate LAN and when I try and embed the pdf as an object I get an Access Denied error.
Also, when an event if fired, the div custDetails is resized to a col-md-6 and when the modal is finished with the divs are resized \ reclassed.
Any and all help on how to show the iFrame the same size as the form next to it would be great.
thanks
Simon
<style>
.row-eq-height {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
iframe {
height: 100%;
position: absolute;
}
</style>
<div class="row row-eq-height">
<div id="loa" class="col-md-6 demo NotShown">
<iframe
src="\\sqlmuldvwsk06.ukskpre.santanderuk.pre.corp\Public\CMCFileUpload\LOAFiles\SRA557034_321043.004.pdf"
class="mh100Percent mw100" frameborder="0" scrolling="no">
<p>It appears your web browser doesn't support iframes.</p>
</iframe>
</div>
<div id="custDetails" class="col-md-6 demo">
...
</div>
</div>
Hope this will work
Here we go...
<div style="display:flex; flex-wrap:wrap; align-items: stretch;">
<div style="background-color:red; border: 2px solid black;">DIV 1<br/>DIV 1<br/>DIV 1<br/>DIV 1<br/></div>
<div style="background-color:green; border: 2px solid black;">DIV 2DIV 1<br/>DIV 2<br/>DIV 2<br/>DIV 2<br/>DIV 2<br/>DIV 2<br/>DIV 2<br/></div>
<div style="background-color:blue; border: 2px solid black;">DIV 3</div>
<div style="background-color:gray; border: 2px solid black;">DIV 4</div>
<div style="background-color:yellow; border: 2px solid black;;">DIV 5</div>
</div>
Hoping it helps...
I'm struggling with getting identical behaviour for a flexbox layout in different browsers (nevermind browsers that don't support flexbox).
Here's the markup:
<!-- nested version -->
<div class="flex-container"> <!-- display: flex -->
<div>
<div class="flex-container inner"> <!-- display: flex -->
<div class="auto-width">
auto take up needed space
</div>
<div class="flex-width"> <!-- flex: 1 -->
flex take up remaining space
</div>
</div>
</div>
</div>
My problem is that IE11 behaves differently to Firefox and Chrome. I would expect that the width of the nested flexbox flex-container.inner will be unrestricted, since nowwhere do I set any width.
Here is a JSBin to illustrate the problem: http://jsbin.com/pabesaci/5. Example 3 is the problematic one which renders differently in IE.
Rendering in IE
Rendering in Chrome (FF is similar)
Is this a bug in IE?
Can you suggest other ways to achieve this layout?
<p>My example:</p>
<div style="float:left; display:block; width: auto; border: solid 2px red; padding: 2px;">
<div>
<div style="float:left; display: block; border: solid 2px yellow; padding:2px;">
<div style="float:left; display: block; border: solid 2px green;">
auto take up needed space
</div>
<div class="" style="float:left; position:relative; display:block; border: solid 2px blue;">
flex take up remaining space
</div>
</div>
</div>
</div>
I have a video player on my site and im trying to get the entire site to go dark when the video plays. I've put a div to wrap all content and made sure the z-index of the video and video container where higher than the div. However it's not working like I'd hoped.
It's also screwing up the alignment of my wrapper. This is my site: http://www3.carleton.ca/clubs/sissa/html5/video.html
When I wrap everything in the Shadow div. Everything moves to the left:
HTML:
<body>
<div id="shadow">
<div id="wrapper">
<a href="index.html">
<header id="top_header">
<h1>MacroPlay Games</h1>
</header>
</a>
<nav id="topnav">
<ul>
<li>Home</li>
<li>About</li>
<li>Trailers</li>
<button type="button" data-state="0" style="float:right">Cinema Mode</button>
</ul>
</nav>
<div id="body_div">
<div id="video_container">
<video id="trailers" poster="poster.jpg">
<source src="vLast.mp4" type="video/mp4">
<source src="vLast.webm" type="video/webm">
</video>
<nav>
<div id="controls" class="cAnimated cFadeInRight">
<div id="defaultBar">
<div id="progressBar"></div>
</div>
<button id="playButton">Play</button>
<button id="vol" onclick="showSlider()">Vol</button>
<button id="containSlider">
<input type="range" id="vSlider" min="0" max="1" step="0.1" value="0.5"/></button>
<div id='containTime'><span id='timeDisplay'>0:00</span><span>/</span><span id='duration'>0:00</span></div>
<button id="full">Full</button>
<button id="mute">Mute</button>
</div>
<div id="playlist" class="animated fadeInRight">
<div class="thumb" id="tb1"><img src="TbGow.jpg" onClick="changeTrailer('vGow')"/></div>
<div class="thumb" id="tb2"><img src="TbLast.jpg" onClick="changeTrailer('vLast')"/></div>
<div class="thumb" id="tb3"><img src="TbTwo.jpg" onClick="changeTrailer('vTwo')"/></div>
</div>
</nav>
</div>
<aside id="sidebar">
<div id="side_events">
<h1>News</h1>
<ul id="events">
<li>Half-Life 3 Release: <time>04/01/13</time></li>
<li>Borderlands 3 Release: <time>05/29/13</time></li>
<li>E3 2013 Starting: <time>08/11/13</time></li>
<li>Playstation 4 Release: <time>08/31/13</time></li>
<li>Xbox 720 Release: <time>09/01/13</time></li>
</ul>
</div>
<div id="side_trailer">
<img src="TbGow.jpg" />
</div>
<div id="side_advert">
<img src="http://i.imgur.com/W65o9R2.jpg" alt="Blackberry's Z10" title="Blackberry's Z10" id="advert">
</div>
</aside>
</div>
<footer id="footer">
© Copyright by SimKessy
</footer>
</div>
</div>
</body>
</html>
Rules pertaining to the div (Shadow):
#shadow{
position:fixed;
width:100%;
height: 100%;
top:0;
left:0;
opacity:0.5;
background-color: red;
z-index: 81;
}
#video_container{
-webkit-box-flex: 1;
-moz-box-flex: 1;
border:5px solid black;
margin: 20px;
padding: 5px;
height: 100%;
position: relative;
background-color:black;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
z-index:0;
}
#video_container video{
width: 100%;
/*height: auto;*/
display: block;
z-index: 0;
}
My codes: http://jsfiddle.net/eXJ5q/
Try this
Add this <div class="dim"></div> just before this <div id="video_container">
Then add this css
.dim {
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.8);
bottom: 0;
left: 0;
position: fixed;
right: 0;
top: 0;
z-index: 1;
}
#video_container{
z-index: 1;
}
You can just make the shadow div as a sibling rather than a parent of the video container, and everything should work as expected. you also don't need a z-index of such a high value. It can just be 1, as long as it is a greater value than those you're trying to obscure.