for school I need to use an HTML5 video player with additional controls and the ability to select a file from a local drive. The page also works locally. Therefore, it does not load. Files (HTML and video) are located in one local folder.
For pick-ups, I use form c <form><input type="file" id="chosen" /><button type="submit" onclick="open();">Change</button></form>. Now here is my JavaScript, which should manipulate the source of the video player:
function open()
{
var file=document.getElementById('chosen');
var fileURL = window.URL.createObjectURL(file);
player.src=fileURL;
player.load();
}
The video player is as follows:
<video id=player>
<source src="big-buck-bunny_trailer.webm" type="video/webm" />
<source src="trailer_480p.mov" type"video/mp4" />
</video>
and, of course, I connected the "player" variable to my video player. Function player.load () - works correctly, so the function gets the correct form.
Now my question is: what is wrong or not in the Javascript-Part? The project does not work as described.
, . ;)