Browse Source

cleanup: remove no longer used code 🔥🔥🔥

The code for handling device availability has been disabled for a long time,
plus it's ill named since it represents 2 abstractions: lack of permissions and
lack of devices.

Time for it to rest in the git graveyard.
dev1
Saúl Ibarra Corretgé 6 years ago
parent
commit
3d02a85744

+ 0
- 6
JitsiConference.js View File

@@ -131,10 +131,6 @@ export default function JitsiConference(options) {
131 131
         audio: false,
132 132
         video: false
133 133
     };
134
-    this.availableDevices = {
135
-        audio: undefined,
136
-        video: undefined
137
-    };
138 134
     this.isMutedByFocus = false;
139 135
 
140 136
     // Flag indicates if the 'onCallEnded' method was ever called on this
@@ -256,8 +252,6 @@ JitsiConference.prototype._init = function(options = {}) {
256 252
     this.room.addListener(
257 253
         XMPPEvents.CONNECTION_ESTABLISHED, this._onIceConnectionEstablished);
258 254
 
259
-    this.room.updateDeviceAvailability(RTC.getDeviceAvailability());
260
-
261 255
     this._updateProperties = this._updateProperties.bind(this);
262 256
     this.room.addListener(XMPPEvents.CONFERENCE_PROPERTIES_CHANGED,
263 257
         this._updateProperties);

+ 0
- 50
JitsiConferenceEventManager.js View File

@@ -391,52 +391,6 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function() {
391 391
         }
392 392
     });
393 393
 
394
-    chatRoom.addPresenceListener('devices', (data, from) => {
395
-        let isAudioAvailable = false;
396
-        let isVideoAvailable = false;
397
-
398
-        data.children.forEach(config => {
399
-            if (config.tagName === 'audio') {
400
-                isAudioAvailable = config.value === 'true';
401
-            }
402
-            if (config.tagName === 'video') {
403
-                isVideoAvailable = config.value === 'true';
404
-            }
405
-        });
406
-
407
-        let availableDevices;
408
-
409
-        if (conference.myUserId() === from) {
410
-            availableDevices = conference.availableDevices;
411
-        } else {
412
-            const participant = conference.getParticipantById(from);
413
-
414
-            if (!participant) {
415
-                return;
416
-            }
417
-
418
-            availableDevices = participant._availableDevices;
419
-        }
420
-
421
-        let updated = false;
422
-
423
-        if (availableDevices.audio !== isAudioAvailable) {
424
-            updated = true;
425
-            availableDevices.audio = isAudioAvailable;
426
-        }
427
-
428
-        if (availableDevices.video !== isVideoAvailable) {
429
-            updated = true;
430
-            availableDevices.video = isVideoAvailable;
431
-        }
432
-
433
-        if (updated) {
434
-            conference.eventEmitter.emit(
435
-                JitsiConferenceEvents.AVAILABLE_DEVICES_CHANGED,
436
-                from, availableDevices);
437
-        }
438
-    });
439
-
440 394
     if (conference.statistics) {
441 395
         // FIXME ICE related events should end up in RTCEvents eventually
442 396
         chatRoom.addListener(XMPPEvents.CONNECTION_ICE_FAILED,
@@ -494,10 +448,6 @@ JitsiConferenceEventManager.prototype.setupRTCListeners = function() {
494 448
         conference.eventEmitter.emit(JitsiConferenceEvents.DATA_CHANNEL_OPENED);
495 449
     });
496 450
 
497
-    rtc.addListener(
498
-        RTCEvents.AVAILABLE_DEVICES_CHANGED,
499
-        devices => conference.room.updateDeviceAvailability(devices));
500
-
501 451
     rtc.addListener(RTCEvents.ENDPOINT_MESSAGE_RECEIVED,
502 452
         (from, payload) => {
503 453
             const participant = conference.getParticipantById(from);

+ 0
- 5
JitsiConferenceEvents.js View File

@@ -7,11 +7,6 @@
7 7
  */
8 8
 export const AUTH_STATUS_CHANGED = 'conference.auth_status_changed';
9 9
 
10
-/**
11
- * Indicates that available devices changed.
12
- */
13
-export const AVAILABLE_DEVICES_CHANGED = 'conference.availableDevicesChanged';
14
-
15 10
 /**
16 11
  * A participant avatar has changed.
17 12
  */

+ 0
- 4
JitsiParticipant.js View File

@@ -34,10 +34,6 @@ export default class JitsiParticipant {
34 34
         this._tracks = [];
35 35
         this._role = 'none';
36 36
         this._status = status;
37
-        this._availableDevices = {
38
-            audio: undefined,
39
-            video: undefined
40
-        };
41 37
         this._hidden = hidden;
42 38
         this._statsID = statsID;
43 39
         this._connectionStatus = ParticipantConnectionStatus.ACTIVE;

+ 0
- 1
doc/API.md View File

@@ -117,7 +117,6 @@ JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
117 117
         - KICKED - notifies that user has been kicked from the conference.
118 118
         - START_MUTED_POLICY_CHANGED - notifies that all new participants will join with muted audio/video stream (parameters - JS object with 2 properties - audio(boolean), video(boolean))
119 119
         - STARTED_MUTED - notifies that the local user has started muted
120
-        - AVAILABLE_DEVICES_CHANGED - notifies that available participant devices changed (camera or microphone was added or removed) (parameters - id(string), devices(JS object with 2 properties - audio(boolean), video(boolean)))
121 120
         - CONNECTION_STATS - New local connection statistics are received. (parameters - stats(object))
122 121
         - BEFORE_STATISTICS_DISPOSED - fired just before the statistics module is disposed and it's the last chance to submit some logs to the statistics service, before it gets disconnected
123 122
         - AUTH_STATUS_CHANGED - notifies that authentication is enabled or disabled, or local user authenticated (logged in). (parameters - isAuthEnabled(boolean), authIdentity(string))

+ 0
- 2
modules/RTC/RTCUtils.js View File

@@ -511,8 +511,6 @@ function setAvailableDevices(um, stream) {
511 511
     if (um.indexOf('audio') !== -1) {
512 512
         devices.audio = audioTracksReceived;
513 513
     }
514
-
515
-    eventEmitter.emit(RTCEvents.AVAILABLE_DEVICES_CHANGED, devices);
516 514
 }
517 515
 
518 516
 /**

+ 0
- 20
modules/xmpp/ChatRoom.js View File

@@ -211,26 +211,6 @@ export default class ChatRoom extends Listenable {
211 211
         }
212 212
     }
213 213
 
214
-    /**
215
-     *
216
-     * @param devices
217
-     */
218
-    updateDeviceAvailability(devices) {
219
-        this.presMap.nodes.push({
220
-            'tagName': 'devices',
221
-            'children': [
222
-                {
223
-                    'tagName': 'audio',
224
-                    'value': devices.audio
225
-                },
226
-                {
227
-                    'tagName': 'video',
228
-                    'value': devices.video
229
-                }
230
-            ]
231
-        });
232
-    }
233
-
234 214
     /**
235 215
      * Joins the chat room.
236 216
      * @param password

+ 0
- 1
service/RTC/RTCEvents.js View File

@@ -30,7 +30,6 @@ const RTCEvents = {
30 30
      */
31 31
     LOCAL_TRACK_SSRC_UPDATED: 'rtc.local_track_ssrc_updated',
32 32
 
33
-    AVAILABLE_DEVICES_CHANGED: 'rtc.available_devices_changed',
34 33
     TRACK_ATTACHED: 'rtc.track_attached',
35 34
 
36 35
     /**

Loading…
Cancel
Save