Skip to content

Commit

Permalink
jitsi: Don't fail when the version of Jitsi doesn't support setReceiv…
Browse files Browse the repository at this point in the history
…erConstraints

Older versions may not have this method. Try to make the change, but
fail cleanly if it can't be set

Fixes #73
  • Loading branch information
bekriebel committed Apr 4, 2021
1 parent 69d4f48 commit 24b6803
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions scripts/jitsirtc.js
Original file line number Diff line number Diff line change
Expand Up @@ -945,14 +945,18 @@ class JitsiRTCClient extends AVClient {
* Uses the new format described here:
* https://github.com/jitsi/jitsi-videobridge/blob/master/doc/allocation.md
*/
this._jitsiConference.setReceiverConstraints({
lastN: -1,
onStageEndpoints: Object.keys(game.webrtc.client._idCache),
defaultConstraints: {
maxHeight: 240,
maxFrameRate: 30,
},
});
try {
this._jitsiConference.setReceiverConstraints({
lastN: -1,
onStageEndpoints: Object.keys(game.webrtc.client._idCache),
defaultConstraints: {
maxHeight: 240,
maxFrameRate: 30,
},
});
} catch (err) {
this.debug("setReceiverConstraints not supported by this Jitsi version; skipping");
}

this.debug("User joined:", displayName);

Expand Down

0 comments on commit 24b6803

Please sign in to comment.