浏览代码

Fixes some translation issues.

master
hristoterezov 10 年前
父节点
当前提交
d2f95f3c81

+ 1
- 1
Makefile 查看文件

21
 
21
 
22
 deploy:
22
 deploy:
23
 	@mkdir -p $(DEPLOY_DIR) && cp $(OUTPUT_DIR)/*.bundle.js $(DEPLOY_DIR)
23
 	@mkdir -p $(DEPLOY_DIR) && cp $(OUTPUT_DIR)/*.bundle.js $(DEPLOY_DIR)
24
-	
24
+	scp $(DEPLOY_DIR)/app.bundle.js hristo.jitsi.net:/srv/web/hristo.jitsi.net/$(DEPLOY_DIR)

+ 1
- 0
app.js 查看文件

14
         this.xmpp = require("./modules/xmpp/xmpp");
14
         this.xmpp = require("./modules/xmpp/xmpp");
15
         this.keyboardshortcut = require("./modules/keyboardshortcut/keyboardshortcut");
15
         this.keyboardshortcut = require("./modules/keyboardshortcut/keyboardshortcut");
16
         this.translation = require("./modules/translation/translation");
16
         this.translation = require("./modules/translation/translation");
17
+        this.settings = require("./modules/settings/Settings");
17
     }
18
     }
18
 };
19
 };
19
 
20
 

+ 10
- 8
config.js 查看文件

1
 var config = {
1
 var config = {
2
     hosts: {
2
     hosts: {
3
-        domain: 'jitsi-meet.example.com',
3
+        domain: 'hristo.jitsi.net',
4
         //anonymousdomain: 'guest.example.com',
4
         //anonymousdomain: 'guest.example.com',
5
-        muc: 'conference.jitsi-meet.example.com', // FIXME: use XEP-0030
6
-        bridge: 'jitsi-videobridge.jitsi-meet.example.com', // FIXME: use XEP-0030
5
+//        anonymousdomain: 'guest.hristo.jitsi.net',
6
+        muc: 'conference.hristo.jitsi.net', // FIXME: use XEP-0030
7
+        bridge: 'jitsi-videobridge.hristo.jitsi.net', // FIXME: use XEP-0030
7
         //jirecon: 'jirecon.jitsi-meet.example.com',
8
         //jirecon: 'jirecon.jitsi-meet.example.com',
8
         //call_control: 'callcontrol.jitsi-meet.example.com',
9
         //call_control: 'callcontrol.jitsi-meet.example.com',
9
         //focus: 'focus.jitsi-meet.example.com' - defaults to 'focus.jitsi-meet.example.com'
10
         //focus: 'focus.jitsi-meet.example.com' - defaults to 'focus.jitsi-meet.example.com'
12
 //  useStunTurn: true, // use XEP-0215 to fetch STUN and TURN server
13
 //  useStunTurn: true, // use XEP-0215 to fetch STUN and TURN server
13
 //  useIPv6: true, // ipv6 support. use at your own risk
14
 //  useIPv6: true, // ipv6 support. use at your own risk
14
     useNicks: false,
15
     useNicks: false,
15
-    bosh: '//jitsi-meet.example.com/http-bind', // FIXME: use xep-0156 for that
16
+    bosh: '//hristo.jitsi.net/http-bind', // FIXME: use xep-0156 for that
16
     clientNode: 'http://jitsi.org/jitsimeet', // The name of client node advertised in XEP-0115 'c' stanza
17
     clientNode: 'http://jitsi.org/jitsimeet', // The name of client node advertised in XEP-0115 'c' stanza
17
     //focusUserJid: 'focus@auth.jitsi-meet.example.com', // The real JID of focus participant - can be overridden here
18
     //focusUserJid: 'focus@auth.jitsi-meet.example.com', // The real JID of focus participant - can be overridden here
18
-    //defaultSipNumber: '', // Default SIP number
19
+    defaultSipNumber: '123', // Default SIP number
19
     desktopSharing: 'ext', // Desktop sharing method. Can be set to 'ext', 'webrtc' or false to disable.
20
     desktopSharing: 'ext', // Desktop sharing method. Can be set to 'ext', 'webrtc' or false to disable.
21
+//    resolution: "1080",
20
     chromeExtensionId: 'diibjkoicjeejcmhdnailmkgecihlobk', // Id of desktop streamer Chrome extension
22
     chromeExtensionId: 'diibjkoicjeejcmhdnailmkgecihlobk', // Id of desktop streamer Chrome extension
21
     desktopSharingSources: ['screen', 'window'],
23
     desktopSharingSources: ['screen', 'window'],
22
     minChromeExtVersion: '0.1', // Required version of Chrome extension
24
     minChromeExtVersion: '0.1', // Required version of Chrome extension
26
     channelLastN: -1, // The default value of the channel attribute last-n.
28
     channelLastN: -1, // The default value of the channel attribute last-n.
27
     adaptiveLastN: false,
29
     adaptiveLastN: false,
28
     adaptiveSimulcast: false,
30
     adaptiveSimulcast: false,
29
-    useRtcpMux: true,
30
-    useBundle: true,
31
-    enableRecording: false,
31
+    useRtcpMux: false,
32
+    useBundle: false,
33
+    enableRecording: true,
32
     enableWelcomePage: true,
34
     enableWelcomePage: true,
33
     enableSimulcast: false,
35
     enableSimulcast: false,
34
     enableFirefoxSupport: false, //firefox support is still experimental, only one-to-one conferences with chrome focus
36
     enableFirefoxSupport: false, //firefox support is still experimental, only one-to-one conferences with chrome focus

+ 2
- 0
css/jitsi_popover.css 查看文件

99
     width: 90px;
99
     width: 90px;
100
     height: 16px;
100
     height: 16px;
101
     padding-top: 4px;
101
     padding-top: 4px;
102
+    padding-left: 10px;
103
+    padding-right: 10px;
102
     margin: 15px auto 0px auto;
104
     margin: 15px auto 0px auto;
103
 }
105
 }

+ 2
- 2
css/settingsmenu.css 查看文件

27
 }
27
 }
28
 
28
 
29
 #settingsmenu button {
29
 #settingsmenu button {
30
-    width: 36%;
31
-    left: 32%;
30
+    width: 45%;
31
+    left: 26%;
32
     padding: 0;
32
     padding: 0;
33
     margin-top: 10px;
33
     margin-top: 10px;
34
 }
34
 }

+ 1
- 1
index.html 查看文件

19
     <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
19
     <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
20
     <script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
20
     <script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
21
     <script src="interface_config.js?v=5"></script>
21
     <script src="interface_config.js?v=5"></script>
22
-    <script src="libs/app.bundle.js?v=31"></script>
22
+    <script src="libs/app.bundle.js?v=32"></script>
23
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
23
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
24
     <link rel="stylesheet" href="css/font.css?v=6"/>
24
     <link rel="stylesheet" href="css/font.css?v=6"/>
25
     <link rel="stylesheet" href="css/toastr.css?v=1">
25
     <link rel="stylesheet" href="css/toastr.css?v=1">

+ 1
- 1
interface_config.js 查看文件

5
     INITIAL_TOOLBAR_TIMEOUT: 20000,
5
     INITIAL_TOOLBAR_TIMEOUT: 20000,
6
     TOOLBAR_TIMEOUT: 4000,
6
     TOOLBAR_TIMEOUT: 4000,
7
     DEFAULT_REMOTE_DISPLAY_NAME: "Fellow Jitster",
7
     DEFAULT_REMOTE_DISPLAY_NAME: "Fellow Jitster",
8
-    DEFAULT_DOMINANT_SPEAKER_DISPLAY_NAME: "Speaker",
8
+    DEFAULT_DOMINANT_SPEAKER_DISPLAY_NAME: "speaker",
9
     DEFAULT_LOCAL_DISPLAY_NAME: "me",
9
     DEFAULT_LOCAL_DISPLAY_NAME: "me",
10
     SHOW_JITSI_WATERMARK: true,
10
     SHOW_JITSI_WATERMARK: true,
11
     JITSI_WATERMARK_LINK: "http://jitsi.org",
11
     JITSI_WATERMARK_LINK: "http://jitsi.org",

+ 14
- 3
lang/main.json 查看文件

3
     "connectionsettings": "Connection Settings",
3
     "connectionsettings": "Connection Settings",
4
     "poweredby": "powered by",
4
     "poweredby": "powered by",
5
     "downloadlogs": "Download logs",
5
     "downloadlogs": "Download logs",
6
+    "roomUrlDefaultMsg": "Your conference is currently being created...",
7
+    "participant": "Participant",
8
+    "me": "me",
9
+    "speaker": "Speaker",
10
+    "defaultNickname": "ex. __name__",
11
+    "defaultPreziLink": "e.g. __url__",
6
     "welcomepage":{
12
     "welcomepage":{
7
         "go": "GO",
13
         "go": "GO",
8
         "roomname": "Enter room name",
14
         "roomname": "Enter room name",
60
     },
66
     },
61
     "bottomtoolbar": {
67
     "bottomtoolbar": {
62
         "chat": "Open / close chat",
68
         "chat": "Open / close chat",
63
-        "filmstrip": "Open / close contact list",
64
-        "contactlist": "Show / hide film strip"
69
+        "filmstrip": "Show / hide film strip",
70
+        "contactlist": "Open / close contact list"
65
     },
71
     },
66
     "chat":{
72
     "chat":{
67
         "nickname": {
73
         "nickname": {
182
         "password": "password",
188
         "password": "password",
183
         "userPassword": "user password",
189
         "userPassword": "user password",
184
         "token": "token"
190
         "token": "token"
185
-
191
+    },
192
+    "email":
193
+    {
194
+        "sharedKey": "This conference is password protected. Please use the following pin when joining:%0D%0A%0D%0A __sharedKey__ %0D%0A%0D%0A",
195
+        "subject": "Invitation to a __appName__ (__conferenceName__)",
196
+        "body": "Hey there, I%27d like to invite you to a __appName__ conference I%27ve just set up.%0D%0A%0D%0APlease click on the following link in order to join the conference.%0D%0A%0D%0A __roomUrl__%0D%0A%0D%0A__sharedKeyText__ Note that __appName__ is currently only supported by Chromium, Google Chrome and Opera, so you need to be using one of these browsers.%0D%0A%0D%0ATalk to you in a sec!"
186
     }
197
     }
187
 }
198
 }

+ 3
- 4
modules/UI/UI.js 查看文件

393
 
393
 
394
 function onMucJoined(jid, info) {
394
 function onMucJoined(jid, info) {
395
     Toolbar.updateRoomUrl(window.location.href);
395
     Toolbar.updateRoomUrl(window.location.href);
396
-    document.getElementById('localNick').appendChild(
397
-        document.createTextNode(Strophe.getResourceFromJid(jid) + ' (me)')
398
-    );
396
+    var meHTML = APP.translation.generateTranslatonHTML("me");
397
+    $("#localNick").html(Strophe.getResourceFromJid(jid) + " (" + meHTML + ")");
399
 
398
 
400
     var settings = Settings.getSettings();
399
     var settings = Settings.getSettings();
401
     // Add myself to the contact list.
400
     // Add myself to the contact list.
408
         ? info.displayName : Strophe.getResourceFromJid(jid);
407
         ? info.displayName : Strophe.getResourceFromJid(jid);
409
 
408
 
410
     if (displayName)
409
     if (displayName)
411
-        onDisplayNameChanged('localVideoContainer', displayName + ' (me)');
410
+        onDisplayNameChanged('localVideoContainer', displayName);
412
 }
411
 }
413
 
412
 
414
 function initEtherpad(name) {
413
 function initEtherpad(name) {

+ 5
- 2
modules/UI/prezi/Prezi.js 查看文件

73
             buttons1.button2 = {title: backButton, value: true};
73
             buttons1.button2 = {title: backButton, value: true};
74
             var linkError = APP.translation.generateTranslatonHTML(
74
             var linkError = APP.translation.generateTranslatonHTML(
75
                 "dialog.preziLinkError");
75
                 "dialog.preziLinkError");
76
+            var defaultUrl = APP.translation.translateString("defaultPreziLink",
77
+                {url: "http://prezi.com/wz7vhjycl7e6/my-prezi"});
76
             var openPreziState = {
78
             var openPreziState = {
77
                 state0: {
79
                 state0: {
78
                     html:   '<h2>' + html + '</h2>' +
80
                     html:   '<h2>' + html + '</h2>' +
79
                             '<input id="preziUrl" type="text" ' +
81
                             '<input id="preziUrl" type="text" ' +
80
-                            'placeholder="e.g. ' +
81
-                            'http://prezi.com/wz7vhjycl7e6/my-prezi" autofocus>',
82
+                            'data-i18n="[placeholder]defaultPreziLink" data-i18n-options=\'' +
83
+                            JSON.stringify({"url": "http://prezi.com/wz7vhjycl7e6/my-prezi"}) +
84
+                            '\' placeholder="' + defaultUrl + '" autofocus>',
82
                     persistent: false,
85
                     persistent: false,
83
                     buttons: buttons,
86
                     buttons: buttons,
84
                     defaultButton: 1,
87
                     defaultButton: 1,

+ 9
- 3
modules/UI/side_pannels/contactlist/ContactList.js 查看文件

38
  *
38
  *
39
  * @param displayName the display name to set
39
  * @param displayName the display name to set
40
  */
40
  */
41
-function createDisplayNameParagraph(displayName) {
41
+function createDisplayNameParagraph(key, displayName) {
42
     var p = document.createElement('p');
42
     var p = document.createElement('p');
43
-    p.innerText = displayName;
43
+    if(displayName)
44
+        p.innerText = displayName;
45
+    else if(key)
46
+    {
47
+        p.setAttribute("data-i18n",key);
48
+        p.innerText = APP.translation.translateString(key);
49
+    }
44
 
50
 
45
     return p;
51
     return p;
46
 }
52
 }
106
         };
112
         };
107
 
113
 
108
         newContact.appendChild(createAvatar(id));
114
         newContact.appendChild(createAvatar(id));
109
-        newContact.appendChild(createDisplayNameParagraph("Participant"));
115
+        newContact.appendChild(createDisplayNameParagraph("participant"));
110
 
116
 
111
         var clElement = contactlist.get(0);
117
         var clElement = contactlist.get(0);
112
 
118
 

+ 14
- 21
modules/UI/toolbars/Toolbar.js 查看文件

197
     var sharedKeyText = "";
197
     var sharedKeyText = "";
198
     if (sharedKey && sharedKey.length > 0) {
198
     if (sharedKey && sharedKey.length > 0) {
199
         sharedKeyText =
199
         sharedKeyText =
200
-            "This conference is password protected. Please use the " +
201
-            "following pin when joining:%0D%0A%0D%0A" +
202
-            sharedKey + "%0D%0A%0D%0A";
200
+            APP.translation.translateString("email.sharedKey",
201
+                {sharedKey: sharedKey});
203
     }
202
     }
204
 
203
 
205
     var conferenceName = roomUrl.substring(roomUrl.lastIndexOf('/') + 1);
204
     var conferenceName = roomUrl.substring(roomUrl.lastIndexOf('/') + 1);
206
-    var subject = "Invitation to a " + interfaceConfig.APP_NAME + " (" + conferenceName + ")";
207
-    var body = "Hey there, I%27d like to invite you to a " + interfaceConfig.APP_NAME +
208
-        " conference I%27ve just set up.%0D%0A%0D%0A" +
209
-        "Please click on the following link in order" +
210
-        " to join the conference.%0D%0A%0D%0A" +
211
-        roomUrl +
212
-        "%0D%0A%0D%0A" +
213
-        sharedKeyText +
214
-        "Note that " + interfaceConfig.APP_NAME + " is currently" +
215
-        " only supported by Chromium," +
216
-        " Google Chrome and Opera, so you need" +
217
-        " to be using one of these browsers.%0D%0A%0D%0A" +
218
-        "Talk to you in a sec!";
205
+    var subject = APP.translation.translateString("email.subject",
206
+        {appName:interfaceConfig.APP_NAME, conferenceName: conferenceName});
207
+    var body = APP.translation.translateString("email.body",
208
+        {appName:interfaceConfig.APP_NAME, sharedKeyText: sharedKeyText,
209
+            roomUrl: roomUrl});
219
 
210
 
220
     if (window.localStorage.displayname) {
211
     if (window.localStorage.displayname) {
221
         body += "%0D%0A%0D%0A" + window.localStorage.displayname;
212
         body += "%0D%0A%0D%0A" + window.localStorage.displayname;
409
      * Opens the invite link dialog.
400
      * Opens the invite link dialog.
410
      */
401
      */
411
     my.openLinkDialog = function () {
402
     my.openLinkDialog = function () {
412
-        var inviteLink;
403
+        var inviteAttreibutes;
404
+
413
         if (roomUrl === null) {
405
         if (roomUrl === null) {
414
-            inviteLink = "Your conference is currently being created...";
406
+            inviteAttreibutes = 'data-i18n="[value]roomUrlDefaultMsg" value="' +
407
+            APP.translation.translateString("roomUrlDefaultMsg") + '"';
415
         } else {
408
         } else {
416
-            inviteLink = encodeURI(roomUrl);
409
+            inviteAttreibutes = "value=\"" + encodeURI(roomUrl) + "\"";
417
         }
410
         }
418
         messageHandler.openTwoButtonDialog("dialog.shareLink",
411
         messageHandler.openTwoButtonDialog("dialog.shareLink",
419
             null, null,
412
             null, null,
420
-            '<input id="inviteLinkRef" type="text" value="' +
421
-                inviteLink + '" onclick="this.select();" readonly>',
413
+            '<input id="inviteLinkRef" type="text" ' +
414
+                inviteAttreibutes + ' onclick="this.select();" readonly>',
422
             false,
415
             false,
423
             "dialog.Invite",
416
             "dialog.Invite",
424
             function (e, v) {
417
             function (e, v) {

+ 55
- 19
modules/UI/videolayout/VideoLayout.js 查看文件

191
 /**
191
 /**
192
  * Sets the display name for the given video span id.
192
  * Sets the display name for the given video span id.
193
  */
193
  */
194
-function setDisplayName(videoSpanId, displayName) {
194
+function setDisplayName(videoSpanId, displayName, key) {
195
     var nameSpan = $('#' + videoSpanId + '>span.displayname');
195
     var nameSpan = $('#' + videoSpanId + '>span.displayname');
196
-    var defaultLocalDisplayName = interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME;
196
+    var defaultLocalDisplayName = APP.translation.generateTranslatonHTML(
197
+        interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME);
197
 
198
 
198
     // If we already have a display name for this video.
199
     // If we already have a display name for this video.
199
     if (nameSpan.length > 0) {
200
     if (nameSpan.length > 0) {
202
         if (nameSpanElement.id === 'localDisplayName' &&
203
         if (nameSpanElement.id === 'localDisplayName' &&
203
             $('#localDisplayName').text() !== displayName) {
204
             $('#localDisplayName').text() !== displayName) {
204
             if (displayName && displayName.length > 0)
205
             if (displayName && displayName.length > 0)
205
-                $('#localDisplayName').html(displayName + ' (me)');
206
+            {
207
+                var meHTML = APP.translation.generateTranslatonHTML("me");
208
+                $('#localDisplayName').html(displayName + ' (' + meHTML + ')');
209
+            }
206
             else
210
             else
207
-                $('#localDisplayName').text(defaultLocalDisplayName);
211
+                $('#localDisplayName').html(defaultLocalDisplayName);
208
         } else {
212
         } else {
209
             if (displayName && displayName.length > 0)
213
             if (displayName && displayName.length > 0)
214
+            {
210
                 $('#' + videoSpanId + '_name').html(displayName);
215
                 $('#' + videoSpanId + '_name').html(displayName);
216
+            }
217
+            else if (key && key.length > 0)
218
+            {
219
+                var nameHtml = APP.translation.generateTranslatonHTML(key);
220
+                $('#' + videoSpanId + '_name').html(nameHtml);
221
+            }
211
             else
222
             else
212
-                $('#' + videoSpanId + '_name').text(interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME);
223
+                $('#' + videoSpanId + '_name').text(
224
+                    interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME);
213
         }
225
         }
214
     } else {
226
     } else {
215
         var editButton = null;
227
         var editButton = null;
220
 
232
 
221
         if (videoSpanId === 'localVideoContainer') {
233
         if (videoSpanId === 'localVideoContainer') {
222
             editButton = createEditDisplayNameButton();
234
             editButton = createEditDisplayNameButton();
223
-            nameSpan.innerText = defaultLocalDisplayName;
235
+            if (displayName && displayName.length > 0) {
236
+                var meHTML = APP.translation.generateTranslatonHTML("me");
237
+                nameSpan.innerHTML = displayName + meHTML;
238
+            }
239
+            else
240
+                nameSpan.innerHTML = defaultLocalDisplayName;
224
         }
241
         }
225
         else {
242
         else {
226
-            nameSpan.innerText = interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME;
227
-        }
243
+            if (displayName && displayName.length > 0) {
228
 
244
 
229
-        if (displayName && displayName.length > 0) {
230
-            nameSpan.innerText = displayName;
245
+                nameSpan.innerText = displayName;
246
+            }
247
+            else
248
+                nameSpan.innerText = interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME;
231
         }
249
         }
232
 
250
 
251
+
233
         if (!editButton) {
252
         if (!editButton) {
234
             nameSpan.id = videoSpanId + '_name';
253
             nameSpan.id = videoSpanId + '_name';
235
         } else {
254
         } else {
245
 
264
 
246
             if (displayName && displayName.length) {
265
             if (displayName && displayName.length) {
247
                 editableText.value
266
                 editableText.value
248
-                    = displayName.substring(0, displayName.indexOf(' (me)'));
267
+                    = displayName;
249
             }
268
             }
250
 
269
 
270
+            var defaultNickname = APP.translation.translateString(
271
+                "defaultNickname", {name: "Jane Pink"});
251
             editableText.setAttribute('style', 'display:none;');
272
             editableText.setAttribute('style', 'display:none;');
252
-            editableText.setAttribute('placeholder', 'ex. Jane Pink');
273
+            editableText.setAttribute('data-18n',
274
+                '[placeholder]defaultNickname');
275
+            editableText.setAttribute("data-i18n-options",
276
+                JSON.stringify({name: "Jane Pink"}));
277
+            editableText.setAttribute("placeholder", defaultNickname);
278
+
253
             $('#' + videoSpanId)[0].appendChild(editableText);
279
             $('#' + videoSpanId)[0].appendChild(editableText);
254
 
280
 
255
             $('#localVideoContainer .displayname')
281
             $('#localVideoContainer .displayname')
1270
 
1296
 
1271
         if (!$('#localDisplayName').is(":visible")) {
1297
         if (!$('#localDisplayName').is(":visible")) {
1272
             if (NicknameHandler.getNickname())
1298
             if (NicknameHandler.getNickname())
1273
-                $('#localDisplayName').text(NicknameHandler.getNickname() + " (me)");
1299
+            {
1300
+                var meHTML = APP.translation.generateTranslatonHTML("me");
1301
+                $('#localDisplayName').html(NicknameHandler.getNickname() + " (" + meHTML + ")");
1302
+            }
1274
             else
1303
             else
1304
+            {
1305
+                var defaultHTML = APP.translation.generateTranslatonHTML(
1306
+                    interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME);
1275
                 $('#localDisplayName')
1307
                 $('#localDisplayName')
1276
-                    .text(interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME);
1308
+                    .html(defaultHTML);
1309
+            }
1277
             $('#localDisplayName').show();
1310
             $('#localDisplayName').show();
1278
         }
1311
         }
1279
 
1312
 
1796
                 === APP.xmpp.myResource())
1829
                 === APP.xmpp.myResource())
1797
             return;
1830
             return;
1798
 
1831
 
1832
+        var members = APP.xmpp.getMembers();
1799
         // Update the current dominant speaker.
1833
         // Update the current dominant speaker.
1800
         if (resourceJid !== currentDominantSpeaker) {
1834
         if (resourceJid !== currentDominantSpeaker) {
1801
             var oldSpeakerVideoSpanId = "participant_" + currentDominantSpeaker,
1835
             var oldSpeakerVideoSpanId = "participant_" + currentDominantSpeaker,
1802
                 newSpeakerVideoSpanId = "participant_" + resourceJid;
1836
                 newSpeakerVideoSpanId = "participant_" + resourceJid;
1803
-            if($("#" + oldSpeakerVideoSpanId + ">span.displayname").text() ===
1804
-                interfaceConfig.DEFAULT_DOMINANT_SPEAKER_DISPLAY_NAME) {
1837
+            var currentJID = APP.xmpp.findJidFromResource(currentDominantSpeaker);
1838
+            var newJID = APP.xmpp.findJidFromResource(resourceJid);
1839
+            if(currentDominantSpeaker && (!members || !members[currentJID] ||
1840
+                !members[currentJID].displayName)) {
1805
                 setDisplayName(oldSpeakerVideoSpanId, null);
1841
                 setDisplayName(oldSpeakerVideoSpanId, null);
1806
             }
1842
             }
1807
-            if($("#" + newSpeakerVideoSpanId + ">span.displayname").text() ===
1808
-                interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME) {
1809
-                setDisplayName(newSpeakerVideoSpanId,
1843
+            if(resourceJid && (!members || !members[newJID] ||
1844
+                !members[newJID].displayName)) {
1845
+                setDisplayName(newSpeakerVideoSpanId, null,
1810
                     interfaceConfig.DEFAULT_DOMINANT_SPEAKER_DISPLAY_NAME);
1846
                     interfaceConfig.DEFAULT_DOMINANT_SPEAKER_DISPLAY_NAME);
1811
             }
1847
             }
1812
             currentDominantSpeaker = resourceJid;
1848
             currentDominantSpeaker = resourceJid;

正在加载...
取消
保存