The motivation: I want users to be able to have a web interface they can use to create subtitles for their videos.
The problem: The subtitles file that gets generated is very small, just a few KB. I don't want users to have to upload a full copy of their video if the only thing I'm going to do is show them the video on the page.
Ideally, I'd like a way for the user to select a file from their computer, and then have it appear on the page immediately. They will be working with a local copy of the video.
Unfortunately this doesn't seem possible, because the value of the file input field gets set to /fakepath/filename.ext, so I can't set the src for a video element to point to the location the user just gave. However, sites like imgur and youtube are able to show you a preview of what you uploaded before it's sent to the server, so I assume they are implementing something similar to what I'm describing here.
Aucun commentaire:
Enregistrer un commentaire