Dispose player

Dispose and re-create a player with Nuevo plugin

dispose() is public function to remove the html associated with videojs player from the document. This is helpful method to dynamically remove and re-create the player with other source(s).
An instance of the player is created using Video.js setup method to initialize a video.
Code snippet
var player = videojs("myPlayer"); 
Code snippet
<script>
	// Find video parent element
	var video_parent = document.getElementById("parent");
	// Remove player from document
	player.dispose();
	// Create new video element and set appropriate attributes
	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");
	// Append new video element to parent element
	video_parent.appendChild(video);
	// Initialize video.js and Nuevo plugin
	player = videojs("newPlayer");
	player.nuevo();
	// Set video sourrce 
	videojs.src({ src:"//domain.com/video.m3u8", type:"application/x-mpegURL"});
	// Start playback
	player.play();

</script>