ScarletsFiction / SFMediaStream

HTML5 media streamer library for playing music, video, playlist, or even live streaming microphone & camera with node server
MIT License
101 stars 30 forks source link

any chance for windows? #8

Open xanthos84 opened 4 years ago

xanthos84 commented 4 years ago

hi, running the server on my linux machine, accessing the example/streamingtest server on my windows machine on the same network, but getting

MediaPresenter.js:118 Uncaught TypeError: Cannot read property 'getUserMedia' of undefined
    at l.t.startRecording (MediaPresenter.js:118)
    at asPresenter ((index):49)
    at HTMLButtonElement.onclick ((index):12)

after clicking on presenter. (using Firefox btw)

Any idea?

StefansArya commented 4 years ago

That's odd, can you check in your browser console if navigator.getUserMedia was available?

The MDN docs was recommend to use this, except it wouldn't exist if the firefox browser was too old.

And also, you need to use https protocol if you're not testing with localhost domain or 127.0.0.1 as it's written on MDN under Privacy and security.

xanthos84 commented 4 years ago

well the error was from the browser console, what other info would you need?

i tested it also on linux, and there it works fine - thats why i mention windows on the title.

i am quite new to npm, how can i start the server with https?

StefansArya commented 4 years ago

You could use Nginx's proxy_pass while using your domain SSL or Apache's reverse proxy. If you only using NodeJS for your server, you can use https module or combine it with express. If you're using Serberries you will need to modify the server example

var https = require("https");
var config = {
    key: fs.readFileSync(/* private key path */),
    cert: fs.readFileSync(/* fullchain path */)
};

// var myserver = new Serberries(...);
myserver.server = https.createServer(config, myserver.onRequest);

// This located on the bottom of server example
myserver.start(443);