JSFiddle - React, Tailwind, and code Playground

by Kevin Faulhaber

HTML

<div id="container"></div>
<button id="playPause">Pause</button>

JavaScript

var con = document.getElementById('container');
var vid = document.createElement('video');
vid.controls = true;
vid.src = "http://www.html5rocks.com/en/tutorials/video/basics/devstories.mp4";
con.appendChild(vid);
vid.play();

var pp = document.getElementById('playPause');
pp.onclick = function(){
    if(vid.paused){
        vid.play();
        pp.innerHTML = "Pause";
    }else{
        vid.pause();
        pp.innerHTML = "Play";
    }
};