<figure>
  <video id="video" src="http://html5videoformatconverter.com/data/images/happyfit2.mp4"></video>
  <figcaption>
    <label id="timer" for="progress" role="timer"></label>
    <button id="play" aria-label="Play" role="button">►</button>
    <progress id="progress" max="100" value="0">Progress</progress>
    </figcaotion>
</figure>
body {
  background-image: radial-gradient(
    circle at top right,
    #17141d,
    white
  );
  display: grid;
  height: 100vh;
  place-items: center;
  width: 100%;
}

figure {
  box-shadow:
    0 2.8px 2.2px rgba(0, 0, 0, 0.034),
    0 6.7px 5.3px rgba(0, 0, 0, 0.048),
    0 12.5px 10px rgba(0, 0, 0, 0.06),
    0 22.3px 17.9px rgba(0, 0, 0, 0.072),
    0 41.8px 33.4px rgba(0, 0, 0, 0.086),
    0 100px 80px rgba(0, 0, 0, 0.12);
  width: 50%;
}

video {
  display: block;
  width: 100%;
}

figcaption {
  align-items: center;
  background: #eaeaea;
  display: grid;
  grid-gap: 1rem;
  grid-template-columns: 50px auto min(115px);
  padding: .5rem;
}

button {
  border: 0;
  background: #e52e71;
  display: inline;
  color: white;
  order: 1;
  padding: .5rem;
  transition: opacity .25s ease-out;
  width: 100%;
}
button:hover {
  cursor: pointer;
  opacity: .8;
}

label {
  order: 2;
  text-align: center;
}

/* Fallback stuff */
progress[value] {
  appearance: none;
  border: none;
  border-radius: 3px;
  box-shadow: 0 2px 3px rgba(0, 0, 0,.25) inset;
  color: dodgerblue;
  display: inline;
  height: 15px;
  order: 1;
  position: relative;
  width: 100%;
}

/* WebKit styles */
progress[value]::-webkit-progress-bar {
  background-color: whiteSmoke;
  border-radius: 3px;
  box-shadow: 0 2px 3px rgba(0, 0, 0,.25) inset;
}

progress[value]::-webkit-progress-value {
  background-image: linear-gradient(
    to right,
    #ff8a00, #e52e71
  );
  border-radius: 3px;
  position: relative;
  transition: width 1s linear;
}

/* Firefox styles */
progress[value]::-moz-progress-bar {
  background-image: -moz-linear-gradient(
    to right,
    #ff8a00, #e52e71
  );
  border-radius: 3px;
  position: relative;
  transition: width 1s linear;
}
const progress = document.getElementById("progress");
const timer = document.getElementById("timer");
button = document.getElementById("play");

function progressLoop() {
  setInterval(function () {
    progress.value = Math.round((video.currentTime / video.duration) * 100);
    timer.innerHTML = Math.round(video.currentTime) + " seconds";
  });
}

function playPause() {
  if (video.paused) {
    video.play();
    button.innerHTML = "&#10073;&#10073;";
  } else {
    video.pause();
    button.innerHTML = "►";
  }
}

button.addEventListener("click", playPause);
video.addEventListener("play", progressLoop);

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.