|
@@ -8,6 +8,8 @@ var VideoLayout = (function (my) {
|
8
|
8
|
};
|
9
|
9
|
my.connectionIndicators = {};
|
10
|
10
|
|
|
11
|
+ var displayedSsrcs = {};
|
|
12
|
+
|
11
|
13
|
my.changeLocalAudio = function(stream) {
|
12
|
14
|
connection.jingle.localAudio = stream;
|
13
|
15
|
|
|
@@ -33,7 +35,7 @@ var VideoLayout = (function (my) {
|
33
|
35
|
|
34
|
36
|
if(!VideoLayout.connectionIndicators["localVideoContainer"]) {
|
35
|
37
|
VideoLayout.connectionIndicators["localVideoContainer"]
|
36
|
|
- = new ConnectionIndicator($("#localVideoContainer")[0]);
|
|
38
|
+ = new ConnectionIndicator($("#localVideoContainer")[0], null);
|
37
|
39
|
}
|
38
|
40
|
|
39
|
41
|
AudioLevels.updateAudioLevelCanvas();
|
|
@@ -181,38 +183,12 @@ var VideoLayout = (function (my) {
|
181
|
183
|
if (largeVideoState.oldJid) {
|
182
|
184
|
var oldResourceJid = Strophe.getResourceFromJid(largeVideoState.oldJid);
|
183
|
185
|
VideoLayout.enableDominantSpeaker(oldResourceJid, false);
|
184
|
|
- if(VideoLayout.connectionIndicators) {
|
185
|
|
- var videoContainerId = null;
|
186
|
|
- if (oldResourceJid == Strophe.getResourceFromJid(connection.emuc.myroomjid)) {
|
187
|
|
- videoContainerId = 'localVideoContainer';
|
188
|
|
- }
|
189
|
|
- else {
|
190
|
|
- videoContainerId = 'participant_' + oldResourceJid;
|
191
|
|
- }
|
192
|
|
- if(VideoLayout.connectionIndicators[videoContainerId])
|
193
|
|
- VideoLayout.connectionIndicators[videoContainerId].setShowHQ(false);
|
194
|
|
- }
|
195
|
|
-
|
196
|
186
|
}
|
197
|
187
|
|
198
|
188
|
// Enable new dominant speaker in the remote videos section.
|
199
|
189
|
if (largeVideoState.userJid) {
|
200
|
190
|
var resourceJid = Strophe.getResourceFromJid(largeVideoState.userJid);
|
201
|
191
|
VideoLayout.enableDominantSpeaker(resourceJid, true);
|
202
|
|
- if(VideoLayout.connectionIndicators)
|
203
|
|
- {
|
204
|
|
- var videoContainerId = null;
|
205
|
|
- if (resourceJid
|
206
|
|
- === Strophe.getResourceFromJid(connection.emuc.myroomjid)) {
|
207
|
|
- videoContainerId = 'localVideoContainer';
|
208
|
|
- }
|
209
|
|
- else {
|
210
|
|
- videoContainerId = 'participant_' + resourceJid;
|
211
|
|
- }
|
212
|
|
- if(VideoLayout.connectionIndicators[videoContainerId])
|
213
|
|
- VideoLayout.connectionIndicators[videoContainerId].setShowHQ(true);
|
214
|
|
- }
|
215
|
|
-
|
216
|
192
|
}
|
217
|
193
|
|
218
|
194
|
if (fade && largeVideoState.isVisible) {
|
|
@@ -376,7 +352,7 @@ var VideoLayout = (function (my) {
|
376
|
352
|
// Set default display name.
|
377
|
353
|
setDisplayName(videoSpanId);
|
378
|
354
|
|
379
|
|
- VideoLayout.connectionIndicators[videoSpanId] = new ConnectionIndicator(container);
|
|
355
|
+ VideoLayout.connectionIndicators[videoSpanId] = new ConnectionIndicator(container, peerJid);
|
380
|
356
|
|
381
|
357
|
var nickfield = document.createElement('span');
|
382
|
358
|
nickfield.className = "nick";
|
|
@@ -1482,6 +1458,21 @@ var VideoLayout = (function (my) {
|
1482
|
1458
|
if (updateFocusedVideoSrc) {
|
1483
|
1459
|
focusedVideoSrc = electedStreamUrl;
|
1484
|
1460
|
}
|
|
1461
|
+ var ssrc = videoSrcToSsrc[selRemoteVideo.attr('src')];
|
|
1462
|
+ displayedSsrcs[ssrc2jid[ssrc]] = ssrc;
|
|
1463
|
+ var jid = ssrc2jid[ssrc];
|
|
1464
|
+ var videoId;
|
|
1465
|
+ if(jid == connection.emuc.myroomjid)
|
|
1466
|
+ {
|
|
1467
|
+ videoId = "localVideoContainer";
|
|
1468
|
+ }
|
|
1469
|
+ else
|
|
1470
|
+ {
|
|
1471
|
+ videoId = "participant_" + Strophe.getResourceFromJid(jid);
|
|
1472
|
+ }
|
|
1473
|
+ var connectionIndicator = VideoLayout.connectionIndicators[videoId];
|
|
1474
|
+ if(connectionIndicator)
|
|
1475
|
+ connectionIndicator.updatePopoverData();
|
1485
|
1476
|
|
1486
|
1477
|
} else {
|
1487
|
1478
|
console.error('Could not find a stream or a session.', session, electedStream);
|
|
@@ -1494,7 +1485,7 @@ var VideoLayout = (function (my) {
|
1494
|
1485
|
* @param videoContainer the video container associated with the indicator.
|
1495
|
1486
|
* @constructor
|
1496
|
1487
|
*/
|
1497
|
|
- function ConnectionIndicator(videoContainer)
|
|
1488
|
+ function ConnectionIndicator(videoContainer, jid)
|
1498
|
1489
|
{
|
1499
|
1490
|
this.videoContainer = videoContainer;
|
1500
|
1491
|
this.bandwidth = null;
|
|
@@ -1504,7 +1495,7 @@ var VideoLayout = (function (my) {
|
1504
|
1495
|
this.resolution = null;
|
1505
|
1496
|
this.transport = [];
|
1506
|
1497
|
this.popover = null;
|
1507
|
|
- this.showHQ = false;
|
|
1498
|
+ this.jid = jid;
|
1508
|
1499
|
this.create();
|
1509
|
1500
|
}
|
1510
|
1501
|
|
|
@@ -1521,16 +1512,6 @@ var VideoLayout = (function (my) {
|
1521
|
1512
|
0: "0px"//empty
|
1522
|
1513
|
};
|
1523
|
1514
|
|
1524
|
|
- /**
|
1525
|
|
- * Sets the value of the property that indicates whether the displayed resolution si the
|
1526
|
|
- * resolution of High Quality stream or Low Quality
|
1527
|
|
- * @param value boolean.
|
1528
|
|
- */
|
1529
|
|
- ConnectionIndicator.prototype.setShowHQ = function (value) {
|
1530
|
|
- this.showHQ = value;
|
1531
|
|
- this.updatePopoverData();
|
1532
|
|
- };
|
1533
|
|
-
|
1534
|
1515
|
ConnectionIndicator.getIP = function(value)
|
1535
|
1516
|
{
|
1536
|
1517
|
return value.substring(0, value.indexOf(":"));
|
|
@@ -1583,17 +1564,38 @@ var VideoLayout = (function (my) {
|
1583
|
1564
|
var resolutionValue = null;
|
1584
|
1565
|
if(this.resolution)
|
1585
|
1566
|
{
|
1586
|
|
- if(this.showHQ && this.resolution.hq)
|
|
1567
|
+ var keys = Object.keys(this.resolution);
|
|
1568
|
+ if(keys.length == 1)
|
1587
|
1569
|
{
|
1588
|
|
- resolutionValue = this.resolution.hq;
|
|
1570
|
+ for(var ssrc in this.resolution)
|
|
1571
|
+ {
|
|
1572
|
+ resolutionValue = this.resolution[ssrc];
|
|
1573
|
+ }
|
1589
|
1574
|
}
|
1590
|
|
- else if(!this.showHQ && this.resolution.lq)
|
|
1575
|
+ else if(keys.length > 1)
|
1591
|
1576
|
{
|
1592
|
|
- resolutionValue = this.resolution.lq;
|
|
1577
|
+ resolutionValue = this.resolution[displayedSsrcs[this.jid]];
|
1593
|
1578
|
}
|
1594
|
1579
|
}
|
1595
|
1580
|
|
1596
|
|
- if(!resolutionValue ||
|
|
1581
|
+ if(this.jid==null)
|
|
1582
|
+ {
|
|
1583
|
+ resolution = "";
|
|
1584
|
+ for(var i in this.resolution)
|
|
1585
|
+ {
|
|
1586
|
+ resolutionValue = this.resolution[i];
|
|
1587
|
+ if(resolutionValue)
|
|
1588
|
+ {
|
|
1589
|
+ if(resolutionValue.height &&
|
|
1590
|
+ resolutionValue.width)
|
|
1591
|
+ {
|
|
1592
|
+ resolution += (resolution == ""? "" : ", ")
|
|
1593
|
+ + resolutionValue.width + "x" + resolutionValue.height;
|
|
1594
|
+ }
|
|
1595
|
+ }
|
|
1596
|
+ }
|
|
1597
|
+ }
|
|
1598
|
+ else if(!resolutionValue ||
|
1597
|
1599
|
!resolutionValue.height ||
|
1598
|
1600
|
!resolutionValue.width)
|
1599
|
1601
|
{
|