Преглед изворни кода

Renames all active speaker references to be called dominant speaker.

j8
damencho пре 9 година
родитељ
комит
3fd68fa0fd

+ 2
- 2
conference.js Прегледај датотеку

361
         room.on(ConferenceEvents.LAST_N_ENDPOINTS_CHANGED, (ids) => {
361
         room.on(ConferenceEvents.LAST_N_ENDPOINTS_CHANGED, (ids) => {
362
             APP.UI.handleLastNEndpoints(ids);
362
             APP.UI.handleLastNEndpoints(ids);
363
         });
363
         });
364
-        room.on(ConferenceEvents.ACTIVE_SPEAKER_CHANGED, (id) => {
365
-            APP.UI.markDominantSpiker(id);
364
+        room.on(ConferenceEvents.DOMINANT_SPEAKER_CHANGED, (id) => {
365
+            APP.UI.markDominantSpeaker(id);
366
         });
366
         });
367
 
367
 
368
         if (!interfaceConfig.filmStripOnly) {
368
         if (!interfaceConfig.filmStripOnly) {

+ 3
- 3
css/videolayout_default.css Прегледај датотеку

407
     pointer-events: none;
407
     pointer-events: none;
408
 }
408
 }
409
 
409
 
410
-#activeSpeaker {
410
+#dominantSpeaker {
411
     visibility: hidden;
411
     visibility: hidden;
412
     width: 150px;
412
     width: 150px;
413
     height: 150px;
413
     height: 150px;
416
     position: relative;
416
     position: relative;
417
 }
417
 }
418
 
418
 
419
-#activeSpeakerAudioLevel {
419
+#dominantSpeakerAudioLevel {
420
     position: absolute;
420
     position: absolute;
421
     top: 0px;
421
     top: 0px;
422
     left: 0px;
422
     left: 0px;
428
     display:none !important;
428
     display:none !important;
429
 }
429
 }
430
 
430
 
431
-#activeSpeakerAvatar {
431
+#dominantSpeakerAvatar {
432
     width: 100px;
432
     width: 100px;
433
     height: 100px;
433
     height: 100px;
434
     top: 25px;
434
     top: 25px;

+ 3
- 3
index.html Прегледај датотеку

149
                 <a class="poweredby" href="http://jitsi.org" target="_new">
149
                 <a class="poweredby" href="http://jitsi.org" target="_new">
150
                     <span data-i18n="poweredby"></span> jitsi.org
150
                     <span data-i18n="poweredby"></span> jitsi.org
151
                 </a>
151
                 </a>
152
-                <div id="activeSpeaker">
153
-                    <img id="activeSpeakerAvatar" src=""/>
154
-                    <canvas id="activeSpeakerAudioLevel"></canvas>
152
+                <div id="dominantSpeaker">
153
+                    <img id="domianatSpeakerAvatar" src=""/>
154
+                    <canvas id="dominantSpeakerAudioLevel"></canvas>
155
                 </div>
155
                 </div>
156
                 <div id="largeVideoWrapper">
156
                 <div id="largeVideoWrapper">
157
                     <video id="largeVideo" muted="true" autoplay oncontextmenu="return false;"></video>
157
                     <video id="largeVideo" muted="true" autoplay oncontextmenu="return false;"></video>

+ 1
- 1
interface_config.js Прегледај датотеку

14
     GENERATE_ROOMNAMES_ON_WELCOME_PAGE: true,
14
     GENERATE_ROOMNAMES_ON_WELCOME_PAGE: true,
15
     APP_NAME: "Jitsi Meet",
15
     APP_NAME: "Jitsi Meet",
16
     INVITATION_POWERED_BY: true,
16
     INVITATION_POWERED_BY: true,
17
-    ACTIVE_SPEAKER_AVATAR_SIZE: 100,
17
+    DOMINANT_SPEAKER_AVATAR_SIZE: 100,
18
     TOOLBAR_BUTTONS: ['authentication', 'microphone', 'camera', 'desktop',
18
     TOOLBAR_BUTTONS: ['authentication', 'microphone', 'camera', 'desktop',
19
         'recording', 'security', 'invite', 'chat', 'prezi', 'etherpad',
19
         'recording', 'security', 'invite', 'chat', 'prezi', 'etherpad',
20
         'fullscreen', 'sip', 'dialpad', 'settings', 'hangup', 'filmstrip',
20
         'fullscreen', 'sip', 'dialpad', 'settings', 'hangup', 'filmstrip',

+ 22
- 6
libs/lib-jitsi-meet.js Прегледај датотеку

41
         this.statistics = new Statistics();
41
         this.statistics = new Statistics();
42
     setupListeners(this);
42
     setupListeners(this);
43
     this.participants = {};
43
     this.participants = {};
44
-    this.lastActiveSpeaker = null;
44
+    this.lastDominantSpeaker = null;
45
     this.dtmfManager = null;
45
     this.dtmfManager = null;
46
     this.somebodySupportsDTMF = false;
46
     this.somebodySupportsDTMF = false;
47
     this.authEnabled = false;
47
     this.authEnabled = false;
745
     });
745
     });
746
 
746
 
747
     conference.rtc.addListener(RTCEvents.DOMINANTSPEAKER_CHANGED, function (id) {
747
     conference.rtc.addListener(RTCEvents.DOMINANTSPEAKER_CHANGED, function (id) {
748
-        if(conference.lastActiveSpeaker !== id && conference.room) {
749
-            conference.lastActiveSpeaker = id;
750
-            conference.eventEmitter.emit(JitsiConferenceEvents.ACTIVE_SPEAKER_CHANGED, id);
748
+        if(conference.lastDominantSpeaker !== id && conference.room) {
749
+            conference.lastDominantSpeaker = id;
750
+            conference.eventEmitter.emit(JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED, id);
751
         }
751
         }
752
     });
752
     });
753
 
753
 
842
      */
842
      */
843
     TRACK_REMOVED: "conference.trackRemoved",
843
     TRACK_REMOVED: "conference.trackRemoved",
844
     /**
844
     /**
845
-     * The active speaker was changed.
845
+     * The dominant speaker was changed.
846
      */
846
      */
847
-    ACTIVE_SPEAKER_CHANGED: "conference.activeSpeaker",
847
+    DOMINANT_SPEAKER_CHANGED: "conference.dominantSpeaker",
848
     /**
848
     /**
849
      * A new user joinned the conference.
849
      * A new user joinned the conference.
850
      */
850
      */
2893
             obtainDevices(options);
2893
             obtainDevices(options);
2894
         },
2894
         },
2895
         function (error) {
2895
         function (error) {
2896
+            Object.keys(options.streams).forEach(function(device) {
2897
+                RTCUtils.stopMediaStream(options.streams[device]);
2898
+            });
2896
             logger.error(
2899
             logger.error(
2897
                 "failed to obtain " + device + " stream - stop", error);
2900
                 "failed to obtain " + device + " stream - stop", error);
2898
             options.errorCallback(JitsiTrackErrors.parseError(error, devices));
2901
             options.errorCallback(JitsiTrackErrors.parseError(error, devices));
3249
                     this.getUserMediaWithConstraints(
3252
                     this.getUserMediaWithConstraints(
3250
                         options.devices,
3253
                         options.devices,
3251
                         function (stream) {
3254
                         function (stream) {
3255
+                            if((options.devices.indexOf("audio") !== -1 &&
3256
+                                !stream.getAudioTracks().length) ||
3257
+                                (options.devices.indexOf("video") !== -1 &&
3258
+                                !stream.getVideoTracks().length))
3259
+                            {
3260
+                                self.stopMediaStream(stream);
3261
+                                reject(JitsiTrackErrors.parseError(
3262
+                                    new Error("Unable to get the audio and " +
3263
+                                        "video tracks."),
3264
+                                    options.devices));
3265
+                                    return;
3266
+                            }
3252
                             if(hasDesktop) {
3267
                             if(hasDesktop) {
3253
                                 screenObtainer.obtainStream(
3268
                                 screenObtainer.obtainStream(
3254
                                     function (desktopStream) {
3269
                                     function (desktopStream) {
3255
                                         successCallback({audioVideo: stream,
3270
                                         successCallback({audioVideo: stream,
3256
                                             desktopStream: desktopStream});
3271
                                             desktopStream: desktopStream});
3257
                                     }, function (error) {
3272
                                     }, function (error) {
3273
+                                        self.stopMediaStream(stream);
3258
                                         reject(
3274
                                         reject(
3259
                                             JitsiTrackErrors.parseError(error,
3275
                                             JitsiTrackErrors.parseError(error,
3260
                                                 options.devices));
3276
                                                 options.devices));

+ 1
- 1
modules/UI/UI.js Прегледај датотеку

606
     );
606
     );
607
 };
607
 };
608
 
608
 
609
-UI.markDominantSpiker = function (id) {
609
+UI.markDominantSpeaker = function (id) {
610
     VideoLayout.onDominantSpeakerChanged(id);
610
     VideoLayout.onDominantSpeakerChanged(id);
611
 };
611
 };
612
 
612
 

+ 8
- 8
modules/UI/audio_levels/AudioLevels.js Прегледај датотеку

9
 let ASDrawContext = null;
9
 let ASDrawContext = null;
10
 let audioLevelCanvasCache = {};
10
 let audioLevelCanvasCache = {};
11
 
11
 
12
-function initActiveSpeakerAudioLevels() {
13
-    let ASRadius = interfaceConfig.ACTIVE_SPEAKER_AVATAR_SIZE / 2;
14
-    let ASCenter = (interfaceConfig.ACTIVE_SPEAKER_AVATAR_SIZE + ASRadius) / 2;
12
+function initDominantSpeakerAudioLevels() {
13
+    let ASRadius = interfaceConfig.DOMINANT_SPEAKER_AVATAR_SIZE / 2;
14
+    let ASCenter = (interfaceConfig.DOMINANT_SPEAKER_AVATAR_SIZE + ASRadius) / 2;
15
 
15
 
16
     // Draw a circle.
16
     // Draw a circle.
17
     ASDrawContext.arc(ASCenter, ASCenter, ASRadius, 0, 2 * Math.PI);
17
     ASDrawContext.arc(ASCenter, ASCenter, ASRadius, 0, 2 * Math.PI);
119
 const AudioLevels = {
119
 const AudioLevels = {
120
 
120
 
121
     init () {
121
     init () {
122
-        ASDrawContext = $('#activeSpeakerAudioLevel')[0].getContext('2d');
123
-        initActiveSpeakerAudioLevels();
122
+        ASDrawContext = $('#dominantSpeakerAudioLevel')[0].getContext('2d');
123
+        initDominantSpeakerAudioLevels();
124
     },
124
     },
125
 
125
 
126
     /**
126
     /**
197
 
197
 
198
         if(id === largeVideoId) {
198
         if(id === largeVideoId) {
199
             window.requestAnimationFrame(function () {
199
             window.requestAnimationFrame(function () {
200
-                AudioLevels.updateActiveSpeakerAudioLevel(audioLevel);
200
+                AudioLevels.updateDominantSpeakerAudioLevel(audioLevel);
201
             });
201
             });
202
         }
202
         }
203
     },
203
     },
204
 
204
 
205
-    updateActiveSpeakerAudioLevel (audioLevel) {
206
-        if($("#activeSpeaker").css("visibility") == "hidden" || ASDrawContext === null) {
205
+    updateDominantSpeakerAudioLevel (audioLevel) {
206
+        if($("#domiantSpeaker").css("visibility") == "hidden" || ASDrawContext === null) {
207
             return;
207
             return;
208
         }
208
         }
209
 
209
 

+ 2
- 2
modules/UI/avatar/Avatar.js Прегледај датотеку

21
     },
21
     },
22
     /**
22
     /**
23
      * Returns image URL for the avatar to be displayed on large video area
23
      * Returns image URL for the avatar to be displayed on large video area
24
-     * where current active speaker is presented.
24
+     * where current dominant speaker is presented.
25
      * @param id id of the user for whom we want to obtain avatar URL
25
      * @param id id of the user for whom we want to obtain avatar URL
26
      */
26
      */
27
-    getActiveSpeakerUrl: function (id) {
27
+    getDominantSpeakerUrl: function (id) {
28
         return this.getGravatarUrl(id, 100);
28
         return this.getGravatarUrl(id, 100);
29
     },
29
     },
30
     /**
30
     /**

+ 4
- 4
modules/UI/videolayout/LargeVideo.js Прегледај датотеку

8
 
8
 
9
 const RTCBrowserType = require("../../RTC/RTCBrowserType");
9
 const RTCBrowserType = require("../../RTC/RTCBrowserType");
10
 
10
 
11
-const avatarSize = interfaceConfig.ACTIVE_SPEAKER_AVATAR_SIZE;
11
+const avatarSize = interfaceConfig.DOMINANT_SPEAKER_AVATAR_SIZE;
12
 
12
 
13
 function getStreamId(stream) {
13
 function getStreamId(stream) {
14
     if(!stream)
14
     if(!stream)
163
         this.stream = null;
163
         this.stream = null;
164
         this.videoType = null;
164
         this.videoType = null;
165
 
165
 
166
-        this.$avatar = $('#activeSpeaker');
166
+        this.$avatar = $('#domiantSpeaker');
167
         this.$wrapper = $('#largeVideoWrapper');
167
         this.$wrapper = $('#largeVideoWrapper');
168
 
168
 
169
         if (!RTCBrowserType.isIExplorer()) {
169
         if (!RTCBrowserType.isIExplorer()) {
387
     }
387
     }
388
 
388
 
389
     /**
389
     /**
390
-     * Updates the src of the active speaker avatar
390
+     * Updates the src of the dominant speaker avatar
391
      */
391
      */
392
     updateAvatar (thumbUrl) {
392
     updateAvatar (thumbUrl) {
393
-        $("#activeSpeakerAvatar").attr('src', thumbUrl);
393
+        $("#dominantSpeakerAvatar").attr('src', thumbUrl);
394
     }
394
     }
395
 
395
 
396
     showAvatar (show) {
396
     showAvatar (show) {

Loading…
Откажи
Сачувај