<div class="aspectration" data-ratio="16:9">
  <iframe src="https://www.youtube.com/embed/upPCohrJcbw?showinfo=0&modestbranding=1" frameborder="0" allowfullscreen="" class="content"></iframe>
</div>
html,
body {
  height: 100vh;
  width: 100vw;
}
body {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.aspectration {
  position: relative;
  width: 100%;
  background-color: orange;  
  animation: change 8s linear alternate infinite;
  
  &[data-ratio="16:9"] {
    width: 30vw;
    height: 16.875vw;
  }
  
  > * {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
  }
}

@keyframes change {
  0% {
    width: 30vw;
    height: 16.875vw;
  }
  100% {
    width: 60vw;
    height: 33.75vw;
  }
}


View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.