I want the user to be able to upload a video and then, by clicking a button, load the video into a tag to view.
Here is an example:
HTML:
function loadvideo() { video = document.getElementById('videoinput').files[0]; videoelement = document.getElementById('videopreview'); videoelement.src = video; ///I don't think this will work as we need to read the file first?? }
<html> <body> <input type="file" accept="mp4" id="videoinput"> <video id="videopreview"> <button onclick="loadvideo()">Load The Video</button> <script type="javascript src="myscript.js"> </body> </html>