{I+=codeWee;}
[CSS] CSS Video Cover and Fit
In HTML,

Do not use width="", hegith=""


<body style="overflow:hidden">
...

<video id="myVideo">
	<source src="myVideo.mp4" type="video/mp4">
</video>


In CSS,

#myVideo{

	position: fixed;
	left: 50%;
	top: 50%;
	transform: translate(-50%,-50%);
	height:100%;
	min-height: 100%;
}

@media (min-aspect-ratio: 16/9){
	#myVideo{

		width: 100%;
		height: auto;
		min-width: 100%; 
		max-height: none;			
	}
}


or



#myVideo{

    height: 100%;
    width: 100%;
    object-fit: cover;
    overflow: hidden;
}

HTML | PHP | C++ | DirectX11 | Javascript | C# | HTML5 | ASP | SQL | General | CSS | Oculus Rift | Unity3d | Virtools SDK | Tip | NSIS | PowerShell | node.js | Web API | RTSP | All
Copyright© 2016 CodeWee.com All rights reserved.