i'm trying to change the video source at the click of a button. The aim is that the user can click the button (ie video title) and the video they want will appear. I'm struggling to get this code to work. Vid 1 appears but non of the buttons are functioning.
Does any one have any thought as to where i'm going wrong? thanks
html
<button onClick="changevid('videos/vid1.mp4')">Video 1</button>
<button onClick="changevid('videos/vid2.mp4')">Video 2</button>
<button onClick="changevid('videos/vid3.mp4')">Video 3</button>
<video controls id="change">
<source src="videos/Vid1.mp4" type="video/mp4"></source>
</video>
JS
<script language="javascript" type="text/javascript">
function changevid(buttonLink) {
document.getElementById('change').src = buttonlink;
}
</script>