meloncholy / vid-streamer

VidStreamer.js: A simple streamer for Flash and HTML5-style videos. Supports HTTP pseudostreaming and works with JW Player's bitrate switching.
http://meloncholy.com
384 stars 64 forks source link

Please help #9

Closed bryansumague closed 10 years ago

bryansumague commented 11 years ago

I setup it like the example on the readme

var http = require("http"); var vidStreamer = require("vid-streamer");

var newSettings = { rootPath: "clips/", forceDownload: true }

var app = http.createServer(vidStreamer.settings(newSettings)); app.listen(3000);

but when run it on localhost:3000

it get me this

Ooh dear

Sorry, I can't find that file. Could you check again?

meloncholy commented 11 years ago

I think this could be for 3 reasons (in order of likelihood)

Your videos are not actually where the program thinks they should be

Check your rootFolder param in config/vidStreamer.json is set to the folder that contains the videos you want to serve up. VidStreamer will then map any requests for videos in clips to that folder. So if we assume you've used the following

rootPath: "clips/",
rootFolder: "/home/cat/videos/"

Requesting http://localhost:3000/clips/me-in-a-box.mp4 will attempt to serve up the file /home/cat/videos/me-in-a-box.mp4. (Also make sure you've included trailing slashes. It should probably allow for both, but right now it doesn't.)

If that still doesn't work, I'd try adding a console.log statement (or a breakpoint if you're using WebStorm) on line 123 to print out info.path. This will tell you exactly what VidStreamer is trying to open and will hopefully help you figure out what's going wrong.

You're not allowed to access that file

You (or the account you're using to run Node) are not allowed to read files from the folder you specified.

You didn't request a file

I haven't played around with this for a little while, so can't remember the circumstances under which this will occur, but if you're failing at line 92 (no info.path attribute) then I'd start by logging reqUrl and req.url at around line 79.

soniagaonkar commented 10 years ago

How about streaming videos from remote location?

meloncholy commented 10 years ago

The package relies on videos being in a locally-accessible directory. You could mount a remote filesystem via e.g. SSH and then use that, which should work. Though I'm not really sure you're trying to do: this isn't designed to be a proxy and clearly there are much more appropriate tools for that.