Skip to content

Instantly share code, notes, and snippets.

View pyroflies's full-sized avatar

Joe Chung pyroflies

View GitHub Profile
@pyroflies
pyroflies / fullscreenvideo.js
Created March 26, 2018 19:17
Full Screen Video Resize Fill
var video = $('#video');
var resizeVideo = function() {
var w = $("body").prop("clientWidth");
var h = window.innerHeight;
var ratio = 0.5625; // 720x1280 or 1080x1920
if (h/w > ratio) {
var width = ((h/720) / (w/1280)) * 100;
video.css('width', width + '%');
video.css('height', '100vh');
} else {
<a href="https://codepen.io/sn8w/pen/cIeyn">Test 1</a>
<br>
<br>
<a href="http://kottenator.github.io/jquery-circle-progress/">Test 2</a>
<br>
<br>
<a href="https://jsfiddle.net/kimmobrunfeldt/72tkyn40/">Test 3</a>
<br>
<br>