I want to change the video src when a certain button is pressed.
File 1 and File 2 are in the same directory
Html file 1:
<div class="videoplayer">
<video class="video" src="videos/something.mp4" controls >
</video>
Html file 2:
<div class="button">
<input class="changeSrc" type="button" name="bttn"
value="Change video src!" onclick="ChangeVideoSrc()">
</div>
Script file 2:
function ChangeVideoSrc() {
???
};
My question is: How can I set from file 2, the video src of file 1. I read about sharing the variables with a cookie, or local storage but I didn't understand it. I hope there is some magic javascript or jquery syntax to do it directly.