<script>
var video_parent = document.getElementById("video_parent");
player.dispose();
var video = document.createElement('video');
video.id = "newPlayer";
video.className="video-js";
video.preload="auto";
video.controls="true";
video.style.width="100%";
video.style.height="100%";
video.setAttribute("playsinline","true");
video_parent.appendChild(video);
player = videojs("newPlayer", license: "key");
player.nuevo();
player.src({ src:"//domain.com/video.m3u8", type:"application/x-mpegURL"});
player.play();
</script>