WordPress OEmbed – responsive video
Adds a container around iframes to allow responsive video when utilising WordPress OEmbed functionality.
jQuery
$("iframe").wrap("<div class='iframe-container'/>");
SCSS
.iframe-container {
position: relative;
padding-bottom: 56.25%;
height: 0;
overflow: hidden;
iframe {
position: absolute;
top:0;
left: 0;
width: 100%;
height: 100%;
}
}