I have an HTML5 video with a width of 100% and also a height of 100% , and I want to wrap a div to fit the size and position of the video (not the video tag, but the video itself) using anything necesary.
[See Fiddle]
HTML:
<div id="wrapper"></div>
<video id="vid" controls preload="none" width="100%" height="100%" poster="http://video-js.zencoder.com/oceans-clip.png">
<source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4'/>
<source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm'/>
<source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg'/>
</video>
CSS:
#wrapper{
width: 2px;
height: 2px;
border: solid 2px red;
position: absolute;
}
JS (jQuery):
setInterval(function(){
$("#vid").height($(window).height() - $("header").height() - 7);
/*There is a header and a bunch of other stuff in the original code*/
}, 10);
This is my first question here so if you need anything I'll be glad to answer. Thanks.
EDIT: What I need is something like this
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…