-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add loop_index configuration for janus #49
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I also merged #53 as discussed with @arpu
I'll update the minijanus dependency in package.json
once networked-aframe/minijanus.js#2 and this PR is merged.
Did you prepare a PR for https://github.com/networked-aframe/janus-plugin-sfu to modify the start.sh
script in the docker image to configure event_loops and allow_loop_indication with environment variables?
src/index.js
Outdated
@@ -186,6 +186,10 @@ class JanusAdapter { | |||
this.onReconnectionError = reconnectionErrorListener; | |||
} | |||
|
|||
setLoops(loops) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use setEventLoops
so that it matches the config in janus?
src/index.js
Outdated
@@ -495,7 +499,7 @@ class JanusAdapter { | |||
var conn = new RTCPeerConnection(this.peerConnectionConfig || DEFAULT_PEER_CONNECTION_CONFIG); | |||
|
|||
debug("pub waiting for sfu"); | |||
await handle.attach("janus.plugin.sfu"); | |||
await handle.attach("janus.plugin.sfu", this.loops && this.clientId? parseInt(this.clientId) % this.loops : undefined); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put a space before the "?" please.
I'll take care of backporting that to the 3.0.x branch once this is merged. I'm using 3.0.x in production currently. |
@vincentfretin on this topic, i think it would be good to skip 4.x release and release 5.x based on 3.0.x with this changes? ( we use 3.0.x in production) |
This is not a major change, we can release |
I haven't prepared one as I figured having it in the config https://github.com/networked-aframe/janus-plugin-sfu/blob/master/docker/confs/janus.jcfg#L91 is enough. Should I prepare one? If yes, I assume it should be the same as e.g. |
Adding support for environment variables will allow to experiment quickly without rebuilding the image. You can indeed do something similar to if [ ! -z "$EVENT_LOOPS" ]; then
sed -i \
-e "s|#event_loops =.*|event_loops = ${EVENT_LOOPS}|" \
/usr/etc/janus/janus.jcfg
fi
if [ ! -z "$ALLOW_LOOP_INDICATION" ]; then
sed -i \
-e "s|#allow_loop_indication =.*|allow_loop_indication = ${ALLOW_LOOP_INDICATION}|" \
/usr/etc/janus/janus.jcfg
fi Can you please test and create the PR? Thanks. |
And also please a note about those new variables in https://github.com/networked-aframe/janus-plugin-sfu/blob/master/docker/README.md |
makes sense, will look into it |
networked-aframe/minijanus.js#2 is merged. "minijanus": "0.6.2" by "@networked-aframe/minijanus": "0.7.0" and change |
I was waiting you to do the change, not sure if this was clear? I cherry-picked the two commits in 3.0.x branch 07616e3 and f98ab69 Congrats for your first contribution in this repo! |
@networked-aframe/naf-janus-adapter 3.1.0 and 4.1.0 released with those changes. |
thank you & apologies, it fell under my radar as I've got a bit on my plate right now. appreciate it |
This PR adds loops for the
loop_index
configuration to pass to theattach
function of the minijanus (networked-aframe/minijanus.js#2).package-lock.json changes due to
npm ci
conflicts