|
@@ -262,11 +262,7 @@ $(document).bind('remotestreamadded.jingle', function (event, data, sid) {
|
262
|
262
|
container = document.getElementById(
|
263
|
263
|
'participant_' + Strophe.getResourceFromJid(data.peerjid));
|
264
|
264
|
if (!container) {
|
265
|
|
- console.warn('no container for', data.peerjid);
|
266
|
|
- // create for now...
|
267
|
|
- // FIXME: should be removed
|
268
|
|
- container = addRemoteVideoContainer(
|
269
|
|
- 'participant_' + Strophe.getResourceFromJid(data.peerjid));
|
|
265
|
+ console.error('no container for', data.peerjid);
|
270
|
266
|
} else {
|
271
|
267
|
//console.log('found container for', data.peerjid);
|
272
|
268
|
}
|
|
@@ -575,17 +571,8 @@ $(document).bind('entered.muc', function (event, jid, info, pres) {
|
575
|
571
|
console.log('entered', jid, info);
|
576
|
572
|
console.log('is focus?' + focus ? 'true' : 'false');
|
577
|
573
|
|
578
|
|
- var videoSpanId = 'participant_' + Strophe.getResourceFromJid(jid);
|
579
|
|
- var container = addRemoteVideoContainer(videoSpanId);
|
580
|
|
-
|
581
|
|
- if (info.displayName)
|
582
|
|
- showDisplayName(videoSpanId, info.displayName);
|
583
|
|
-
|
584
|
|
- var nickfield = document.createElement('span');
|
585
|
|
- nickfield.className = "nick";
|
586
|
|
- nickfield.appendChild(document.createTextNode(Strophe.getResourceFromJid(jid)));
|
587
|
|
- container.appendChild(nickfield);
|
588
|
|
- resizeThumbnails();
|
|
574
|
+ // Add Peer's container
|
|
575
|
+ ensurePeerContainerExists(jid);
|
589
|
576
|
|
590
|
577
|
if (focus !== null) {
|
591
|
578
|
// FIXME: this should prepare the video
|
|
@@ -600,12 +587,6 @@ $(document).bind('entered.muc', function (event, jid, info, pres) {
|
600
|
587
|
else if (sharedKey) {
|
601
|
588
|
updateLockButton();
|
602
|
589
|
}
|
603
|
|
-
|
604
|
|
- $(pres).find('>media[xmlns="http://estos.de/ns/mjs"]>source').each(function (idx, ssrc) {
|
605
|
|
- //console.log(jid, 'assoc ssrc', ssrc.getAttribute('type'), ssrc.getAttribute('ssrc'));
|
606
|
|
- // Fixme: direction and video types are unhandled here(maybe something more)
|
607
|
|
- ssrc2jid[ssrc.getAttribute('ssrc')] = jid;
|
608
|
|
- });
|
609
|
590
|
});
|
610
|
591
|
|
611
|
592
|
$(document).bind('left.muc', function (event, jid) {
|
|
@@ -674,10 +655,12 @@ $(document).bind('presence.muc', function (event, jid, info, pres) {
|
674
|
655
|
});
|
675
|
656
|
|
676
|
657
|
if (info.displayName) {
|
677
|
|
- if (jid === connection.emuc.myroomjid)
|
|
658
|
+ if (jid === connection.emuc.myroomjid) {
|
678
|
659
|
showDisplayName('localVideoContainer', info.displayName + ' (me)');
|
679
|
|
- else
|
|
660
|
+ } else {
|
|
661
|
+ ensurePeerContainerExists(jid);
|
680
|
662
|
showDisplayName('participant_' + Strophe.getResourceFromJid(jid), info.displayName);
|
|
663
|
+ }
|
681
|
664
|
}
|
682
|
665
|
});
|
683
|
666
|
|
|
@@ -1389,6 +1372,28 @@ function showFocusIndicator() {
|
1389
|
1372
|
}
|
1390
|
1373
|
}
|
1391
|
1374
|
|
|
1375
|
+/**
|
|
1376
|
+ * Checks if container for participant identified by given peerJid exists in the document and creates it eventually.
|
|
1377
|
+ * @param peerJid peer Jid to check.
|
|
1378
|
+ */
|
|
1379
|
+function ensurePeerContainerExists(peerJid){
|
|
1380
|
+
|
|
1381
|
+ var peerResource = Strophe.getResourceFromJid(peerJid);
|
|
1382
|
+ var videoSpanId = 'participant_' + peerResource;
|
|
1383
|
+
|
|
1384
|
+ if($('#'+videoSpanId).length > 0) {
|
|
1385
|
+ return;
|
|
1386
|
+ }
|
|
1387
|
+
|
|
1388
|
+ var container = addRemoteVideoContainer(videoSpanId);
|
|
1389
|
+
|
|
1390
|
+ var nickfield = document.createElement('span');
|
|
1391
|
+ nickfield.className = "nick";
|
|
1392
|
+ nickfield.appendChild(document.createTextNode(peerResource));
|
|
1393
|
+ container.appendChild(nickfield);
|
|
1394
|
+ resizeThumbnails();
|
|
1395
|
+}
|
|
1396
|
+
|
1392
|
1397
|
function addRemoteVideoContainer(id) {
|
1393
|
1398
|
var container = document.createElement('span');
|
1394
|
1399
|
container.id = id;
|