Skip to content

Loading…

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

Closed
wlaurance opened this Issue · 5 comments

3 participants

@wlaurance

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?

@wlaurance wlaurance added a commit to wlaurance/vid-streamer that referenced this issue
@wlaurance wlaurance Allow options to be passed to vidStreamer
while still allowing config/vidStreamer.json to be used

Closes #3
84a5177
@meloncholy
Owner

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
Owner

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 wlaurance added a commit to wlaurance/vid-streamer that referenced this issue
@wlaurance wlaurance add try/catch to config file
See #3
0ae0b35
@wlaurance

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

@meloncholy
Owner

Cool, thanks. Merged.

@meloncholy meloncholy closed this
@alizowghi

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.