Przeglądaj źródła

Renames all active speaker references to be called dominant speaker.

j8
damencho 9 lat temu
rodzic
commit
3fd68fa0fd

+ 2
- 2
conference.js Wyświetl plik

@@ -361,8 +361,8 @@ export default {
361 361
         room.on(ConferenceEvents.LAST_N_ENDPOINTS_CHANGED, (ids) => {
362 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 368
         if (!interfaceConfig.filmStripOnly) {

+ 3
- 3
css/videolayout_default.css Wyświetl plik

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

+ 3
- 3
index.html Wyświetl plik

@@ -149,9 +149,9 @@
149 149
                 <a class="poweredby" href="http://jitsi.org" target="_new">
150 150
                     <span data-i18n="poweredby"></span> jitsi.org
151 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 155
                 </div>
156 156
                 <div id="largeVideoWrapper">
157 157
                     <video id="largeVideo" muted="true" autoplay oncontextmenu="return false;"></video>

+ 1
- 1
interface_config.js Wyświetl plik

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

+ 22
- 6
libs/lib-jitsi-meet.js Wyświetl plik

@@ -41,7 +41,7 @@ function JitsiConference(options) {
41 41
         this.statistics = new Statistics();
42 42
     setupListeners(this);
43 43
     this.participants = {};
44
-    this.lastActiveSpeaker = null;
44
+    this.lastDominantSpeaker = null;
45 45
     this.dtmfManager = null;
46 46
     this.somebodySupportsDTMF = false;
47 47
     this.authEnabled = false;
@@ -745,9 +745,9 @@ function setupListeners(conference) {
745 745
     });
746 746
 
747 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,9 +842,9 @@ var JitsiConferenceEvents = {
842 842
      */
843 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 849
      * A new user joinned the conference.
850 850
      */
@@ -2893,6 +2893,9 @@ function obtainDevices(options) {
2893 2893
             obtainDevices(options);
2894 2894
         },
2895 2895
         function (error) {
2896
+            Object.keys(options.streams).forEach(function(device) {
2897
+                RTCUtils.stopMediaStream(options.streams[device]);
2898
+            });
2896 2899
             logger.error(
2897 2900
                 "failed to obtain " + device + " stream - stop", error);
2898 2901
             options.errorCallback(JitsiTrackErrors.parseError(error, devices));
@@ -3249,12 +3252,25 @@ var RTCUtils = {
3249 3252
                     this.getUserMediaWithConstraints(
3250 3253
                         options.devices,
3251 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 3267
                             if(hasDesktop) {
3253 3268
                                 screenObtainer.obtainStream(
3254 3269
                                     function (desktopStream) {
3255 3270
                                         successCallback({audioVideo: stream,
3256 3271
                                             desktopStream: desktopStream});
3257 3272
                                     }, function (error) {
3273
+                                        self.stopMediaStream(stream);
3258 3274
                                         reject(
3259 3275
                                             JitsiTrackErrors.parseError(error,
3260 3276
                                                 options.devices));

+ 1
- 1
modules/UI/UI.js Wyświetl plik

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

+ 8
- 8
modules/UI/audio_levels/AudioLevels.js Wyświetl plik

@@ -9,9 +9,9 @@ const LOCAL_LEVEL = 'local';
9 9
 let ASDrawContext = null;
10 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 16
     // Draw a circle.
17 17
     ASDrawContext.arc(ASCenter, ASCenter, ASRadius, 0, 2 * Math.PI);
@@ -119,8 +119,8 @@ function getVideoSpanId(id) {
119 119
 const AudioLevels = {
120 120
 
121 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,13 +197,13 @@ const AudioLevels = {
197 197
 
198 198
         if(id === largeVideoId) {
199 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 207
             return;
208 208
         }
209 209
 

+ 2
- 2
modules/UI/avatar/Avatar.js Wyświetl plik

@@ -21,10 +21,10 @@ var Avatar = {
21 21
     },
22 22
     /**
23 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 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 28
         return this.getGravatarUrl(id, 100);
29 29
     },
30 30
     /**

+ 4
- 4
modules/UI/videolayout/LargeVideo.js Wyświetl plik

@@ -8,7 +8,7 @@ import BottomToolbar from '../toolbars/BottomToolbar';
8 8
 
9 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 13
 function getStreamId(stream) {
14 14
     if(!stream)
@@ -163,7 +163,7 @@ class VideoContainer extends LargeContainer {
163 163
         this.stream = null;
164 164
         this.videoType = null;
165 165
 
166
-        this.$avatar = $('#activeSpeaker');
166
+        this.$avatar = $('#domiantSpeaker');
167 167
         this.$wrapper = $('#largeVideoWrapper');
168 168
 
169 169
         if (!RTCBrowserType.isIExplorer()) {
@@ -387,10 +387,10 @@ export default class LargeVideoManager {
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 392
     updateAvatar (thumbUrl) {
393
-        $("#activeSpeakerAvatar").attr('src', thumbUrl);
393
+        $("#dominantSpeakerAvatar").attr('src', thumbUrl);
394 394
     }
395 395
 
396 396
     showAvatar (show) {

Ładowanie…
Anuluj
Zapisz