These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:10 pm Advanced search

Give me access to your files (1k geek points)

Here you can discuss things related to HTML and the Web in general that do not fit in to other categories.

Give me access to your files (1k geek points)

Postby paxcoder » Mon Mar 08, 2010 9:43 pm

Greetings,
I know you won't believe me but I *really* need to make a "video player" type of page which would enable the user to load and view his own video (stored locally). I'm not being stupid, the website will enable other features which would justify viewing videos using the page (undisclosed).

However, as you may know, the "file://" is rightfully blocked by browsers when a "remote" page tries to access local files. So I can't just slap it in the video tag - it won't open it. Unfortunately, so far the only way for a user to allow this is to manually change browser settings in "about:config". I think we all agree no one wants to do that.
Now I don't want to steal anything - eg. a browse style button that would enable this would be perfect. But downloading to the user's computer (which would enable "file://") and opening it locally defeats the whole purpose of it being a web page.

Downloading third party plugins is also out of the question (especially the proprietary ones). So you see, I'm in a bit of a trouble here. Is there *anything* I could do to load the file that user wants to load (no upload, I can't host videos, nor spare bandwidth to send it back to the user which is a ridiculous idea anyway)? Javascript, new html5 stuff; canvas, drafts, experimental stuff, dirty hacks, I'll go for absolutely anything.

Apart from 1k geek points for *any* helpful suggestion. Possible other kinds of rewards :-)
paxcoder
<h6>
 
Posts: 1
Joined: Mon Mar 08, 2010 9:12 pm

Re: Give me access to your files (1k geek points)

Postby zcorpan » Thu Mar 31, 2011 7:11 pm

You can do this with the File API - let the user select the video from an <input type=file>, then grab the File object from input.files[0]. Or let the user drag and drop the video into your page, and get the File from the drop event (or how it's done with drag and drop, don't recall). Then you use URL.createObjectURL(myfile) and stick that into video.src.
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest