JSFiddle - React, Tailwind, and code Playground
HTML
<button onClick="setvideo('video.mp4');">Video1</button>
<button onClick="setvideo('video2.mp4');">Video2</button>
<div id="div_video">
<video autoplay id="video_ctrl" style="height: 100px; width: 100px;">
<source src="video.mp4" type="video/mp4" />
</video>
</div>
JavaScript
function setvideo(src) {
document.getElementById('div_video').innerHTML = '<video autoplay controls id="video_ctrl" style="height: 100px; width: 100px;"><source src="' + src + '" type="video/mp4"></video>';
}