JSFiddle - React, Tailwind, and code Playground
HTML
<!-- Place in "Custom HTML/JS element -->
<iframe width="560" height="315" src="https://www.youtube.com/embed/DvfDMh5kyts?rel=0&controls=0&showinfo=0;loop=1;autoplay=1;playlist=DvfDMh5kyts" frameborder="0" allowfullscreen></iframe>
<!-- This needs to go in Tracking Code Footer section -->
<script>
$( document ).ready(function() {
var vidWidth = $('#VIDEO-ROW-ID iframe').width();
var vidHeight = $('#VIDEO-ROW-ID iframe').height();
var rowWidth = $('#VIDEO-ROW-ID').width();
var sectionHeight = $('#VIDEO-SECTION-ID').outerHeight();
var newVidHeight = (vidHeight * rowWidth) / vidWidth;
var vidOffset = ((newVidHeight - sectionHeight) / 2) * -1;
$('#VIDEO-ROW-ID iframe').width(rowWidth).height(newVidHeight);
$('#VIDEO-ROW-ID iframe').css('top', vidOffset);
});
</script>
CSS
/* --------------- ClickFunnels Video BG --------------- */
/* ------------------ By Matt Hopkins ------------------ */
/* --- © 2017 ZAGG Studios, Ltd. All rights reserved --- */
#VIDEO-SECTION-ID {
background-position: 50% 40%;
background-size: cover;
}
#VIDEO-SECTION-ID .containerInner {
width: 100% !important;
overflow: hidden;
position: relative
}
#VIDEO-SECTION-ID #VIDEO-ROW-ID iframe {
position: absolute;
margin: 0;
padding: 0;
top: 50%;
}
#CONTENT-ROW-ID {
width: 1170px;
max-width: 100%;
margin: 0 auto !important;
}