I want to pass javascript variable as src to html5 video so that the video changes dynamically based on the js variable value. However I am not able to achieve it
<script type="text/javascript">
var path = "/api/Videos/mp4/";
var filename = '@ViewBag.filename';
var fullPath = path.concat(filename);
document.getElementById('fullPath1').src = fullPath.toString();
</script>
<p><script type="text/javascript">document.write(fullPath)</script></p>
<video width="480" height="320" controls="controls" autoplay="autoplay">
<source src="fullPath1" type="video/mp4">
</video>
Please help me to get this working. Thanks!