<!DOCTYPE html>
<video width="200"></video>
<script>
function createSource(src, media) {
  var source = document.createElement('source');
  source.src = src;
  if (media) {
    source.media = media;
  }
  return source;
}
const rAF = () => new Promise(resolve => requestAnimationFrame(resolve));
const hash = str => str.substr(str.lastIndexOf('#'));
(async () => {
  const v = document.querySelector('video');
  v.getBoundingClientRect(); // force layout flush. ensure viewport dimensions are up-to-date
  v.appe