Browse Source

Advertise support for opus/red.

master
Boris Grozev 4 years ago
parent
commit
16fe22e9c9
3 changed files with 23 additions and 0 deletions
  1. 12
    0
      modules/browser/BrowserCapabilities.js
  2. 8
    0
      modules/xmpp/moderator.js
  3. 3
    0
      modules/xmpp/xmpp.js

+ 12
- 0
modules/browser/BrowserCapabilities.js View File

@@ -286,6 +286,18 @@ export default class BrowserCapabilities extends BrowserDetection {
286 286
                 || window.RTCRtpSender.prototype.createEncodedVideoStreams));
287 287
     }
288 288
 
289
+    /**
290
+     * Whether the browser supports the RED format for audio.
291
+     */
292
+    supportsAudioRed() {
293
+        return Boolean(window.RTCRtpSender
294
+            && window.RTCRtpSender.getCapabilities
295
+            && window.RTCRtpSender.getCapabilities('audio').codecs.some(codec => codec.mimeType === 'audio/red')
296
+            && window.RTCRtpReceiver
297
+            && window.RTCRtpReceiver.getCapabilities
298
+            && window.RTCRtpReceiver.getCapabilities('audio').codecs.some(codec => codec.mimeType === 'audio/red'));
299
+    }
300
+
289 301
     /**
290 302
      * Checks if the browser supports the "sdpSemantics" configuration option.
291 303
      * https://webrtc.org/web-apis/chrome/unified-plan/

+ 8
- 0
modules/xmpp/moderator.js View File

@@ -3,6 +3,7 @@
3 3
 import { getLogger } from 'jitsi-meet-logger';
4 4
 import { $iq, Strophe } from 'strophe.js';
5 5
 
6
+import browser from '../browser';
6 7
 import Settings from '../settings/Settings';
7 8
 
8 9
 const AuthenticationEvents
@@ -204,6 +205,13 @@ Moderator.prototype.createConferenceIq = function() {
204 205
                     value: Boolean(config.enableRemb)
205 206
                 }).up();
206 207
     }
208
+    if (config.enableOpusRed === true && browser.supportsAudioRed()) {
209
+        elem.c(
210
+                'property', {
211
+                    name: 'enableOpusRed',
212
+                    value: true
213
+                }).up();
214
+    }
207 215
     if (config.minParticipants !== undefined) {
208 216
         elem.c(
209 217
                 'property', {

+ 3
- 0
modules/xmpp/xmpp.js View File

@@ -150,6 +150,9 @@ export default class XMPP extends Listenable {
150 150
         if (!this.options.disableRtx) {
151 151
             this.caps.addFeature('urn:ietf:rfc:4588');
152 152
         }
153
+        if (this.options.enableOpusRed === true) {
154
+            this.caps.addFeature('http://jitsi.org/opus-red');
155
+        }
153 156
 
154 157
         // this is dealt with by SDP O/A so we don't need to announce this
155 158
         // XEP-0293

Loading…
Cancel
Save