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

Ability to set options from a function and config/vidStreamer.json #3

Closed wlaurance closed 11 years ago

wlaurance commented 11 years ago

I want the ability to set the settings outside of the config folder.

Would this be something you would merge in if I do the task?

meloncholy commented 11 years ago

Yes, in principle. Sounds like a good idea.

How were you thinking of doing it? I've done this elsewhere with something like

function vidStreamer(settings) {
    var exports = {};
    settings = settings || defaultSettings;

    exports.vidStreamer = function (req, res) {...}

    ...

    return exports;
}

module.exports = vidStreamer;

Edit: Tired or can't type. Sorry.

meloncholy commented 11 years ago

Thanks for that. I should have thought before I replied the last time that it would be better to avoid changing the way the streamer is initialised (vidStreamer vs vidStreamer()) so it doesn't break anyone's code if they update.

So I've left that as is and added an optional settings() function to pass in options yourself. Does that work for you? Commit.

wlaurance commented 11 years ago

Yes, the settings function works for me. I just needed to wrap the config file require in a try/catch.

meloncholy commented 11 years ago

Cool, thanks. Merged.

alizowghi commented 8 years ago

Hello Very thanks.

There is a problem with my video player. When I go forward in streaming video waits until video loads

That is not seekable ...

What is problem?