1const videoBgIframes = Array.from(document.getElementsByClassName('video-background')); 2 3const resizeIframeWrap = (function resizeIframe(iframes){ 4 iframes.forEach(item => { 5 let videoContainer = item.closest('.video-wrapper'); 6 let videoContainerRatio = videoContainer.clientWidth / videoContainer.clientHeight; 7 let videoRatio = 16 / 9; 8 9 item.removeAttribute('style'); 10 // taller 11 if(videoContainerRatio < videoRatio){ 12 let newWidth = videoContainer.clientHeight * videoRatio; 13 14 item.style.width = newWidth + 'px'; 15 item.style.marginLeft = newWidth / -2 + 'px'; 16 item.style.left = videoContainer.clientWidth / 2 + 'px'; 17 18 // wider 19 }else{ 20 let newHeight = videoContainer.clientWidth * videoRatio; 21 22 item.style.height = newHeight + 'px'; 23 item.style.marginTop = newHeight / -2 + 'px'; 24 item.style.top = videoContainer.clientHeight / 2 + 'px'; 25 } 26 }); 27 28 return resizeIframe; 29})(videoBgIframes); 30 31window.addEventListener('resize', e => { 32 resizeIframeWrap(videoBgIframes); 33}); 34 35videoBgIframes.forEach(item => { 36 let controls = Array.from(item.nextElementSibling.getElementsByClassName('video-control'))[0]; 37 let player = new Vimeo.Player(item); 38 39 controls.addEventListener('click', e => { 40 player.getPaused().then(function(paused){ 41 if(paused){ 42 player.play(); 43 controls.textContent = HTMLEntityDecode('ï'); 44 }else{ 45 player.pause(); 46 controls.textContent = HTMLEntityDecode('ï'); 47 } 48 }); 49 }); 50});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.