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
                 || window.RTCRtpSender.prototype.createEncodedVideoStreams));
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
      * Checks if the browser supports the "sdpSemantics" configuration option.
302
      * Checks if the browser supports the "sdpSemantics" configuration option.
291
      * https://webrtc.org/web-apis/chrome/unified-plan/
303
      * https://webrtc.org/web-apis/chrome/unified-plan/

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

3
 import { getLogger } from 'jitsi-meet-logger';
3
 import { getLogger } from 'jitsi-meet-logger';
4
 import { $iq, Strophe } from 'strophe.js';
4
 import { $iq, Strophe } from 'strophe.js';
5
 
5
 
6
+import browser from '../browser';
6
 import Settings from '../settings/Settings';
7
 import Settings from '../settings/Settings';
7
 
8
 
8
 const AuthenticationEvents
9
 const AuthenticationEvents
204
                     value: Boolean(config.enableRemb)
205
                     value: Boolean(config.enableRemb)
205
                 }).up();
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
     if (config.minParticipants !== undefined) {
215
     if (config.minParticipants !== undefined) {
208
         elem.c(
216
         elem.c(
209
                 'property', {
217
                 'property', {

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

150
         if (!this.options.disableRtx) {
150
         if (!this.options.disableRtx) {
151
             this.caps.addFeature('urn:ietf:rfc:4588');
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
         // this is dealt with by SDP O/A so we don't need to announce this
157
         // this is dealt with by SDP O/A so we don't need to announce this
155
         // XEP-0293
158
         // XEP-0293

Loading…
Cancel
Save