|
@@ -380,11 +380,12 @@ var VideoLayout = (function (my) {
|
380
|
380
|
var videoSpanId = 'participant_' + resourceJid;
|
381
|
381
|
|
382
|
382
|
if ($('#' + videoSpanId).length > 0) {
|
383
|
|
- // If there's been a focus change, make sure we add focus related
|
384
|
|
- // interface!!
|
385
|
|
- if (focus && $('#remote_popupmenu_' + resourceJid).length <= 0)
|
386
|
|
- addRemoteVideoMenu( peerJid,
|
387
|
|
- document.getElementById(videoSpanId));
|
|
383
|
+ // If there's been a moderator change, make sure we add moderator
|
|
384
|
+ // related interface!!
|
|
385
|
+ if (Moderator.isModerator() &&
|
|
386
|
+ $('#remote_popupmenu_' + resourceJid).length <= 0)
|
|
387
|
+ addRemoteVideoMenu(peerJid,
|
|
388
|
+ document.getElementById(videoSpanId));
|
388
|
389
|
}
|
389
|
390
|
else {
|
390
|
391
|
var container
|
|
@@ -419,7 +420,7 @@ var VideoLayout = (function (my) {
|
419
|
420
|
|
420
|
421
|
// If the peerJid is null then this video span couldn't be directly
|
421
|
422
|
// associated with a participant (this could happen in the case of prezi).
|
422
|
|
- if (focus && peerJid != null)
|
|
423
|
+ if (Moderator.isModerator() && peerJid !== null)
|
423
|
424
|
addRemoteVideoMenu(peerJid, container);
|
424
|
425
|
|
425
|
426
|
remotes.appendChild(container);
|
|
@@ -772,42 +773,47 @@ var VideoLayout = (function (my) {
|
772
|
773
|
};
|
773
|
774
|
|
774
|
775
|
/**
|
775
|
|
- * Shows a visual indicator for the focus of the conference.
|
776
|
|
- * Currently if we're not the owner of the conference we obtain the focus
|
777
|
|
- * from the connection.jingle.sessions.
|
|
776
|
+ * Shows a visual indicator for the moderator of the conference.
|
778
|
777
|
*/
|
779
|
|
- my.showFocusIndicator = function() {
|
780
|
|
- if (focus !== null) {
|
|
778
|
+ my.showModeratorIndicator = function () {
|
|
779
|
+ if (Moderator.isModerator()) {
|
781
|
780
|
var indicatorSpan = $('#localVideoContainer .focusindicator');
|
782
|
781
|
|
783
|
782
|
if (indicatorSpan.children().length === 0)
|
784
|
783
|
{
|
785
|
|
- createFocusIndicatorElement(indicatorSpan[0]);
|
|
784
|
+ createModeratorIndicatorElement(indicatorSpan[0]);
|
786
|
785
|
}
|
787
|
|
- }
|
788
|
|
- else if (Object.keys(connection.jingle.sessions).length > 0) {
|
789
|
|
- // If we're only a participant the focus will be the only session we have.
|
790
|
|
- var session
|
791
|
|
- = connection.jingle.sessions
|
792
|
|
- [Object.keys(connection.jingle.sessions)[0]];
|
793
|
|
- var focusId
|
794
|
|
- = 'participant_' + Strophe.getResourceFromJid(session.peerjid);
|
795
|
|
-
|
796
|
|
- var focusContainer = document.getElementById(focusId);
|
797
|
|
- if (!focusContainer) {
|
798
|
|
- console.error("No focus container!");
|
799
|
|
- return;
|
800
|
|
- }
|
801
|
|
- var indicatorSpan = $('#' + focusId + ' .focusindicator');
|
|
786
|
+ } else {
|
|
787
|
+ Object.keys(connection.emuc.members).forEach(function (jid) {
|
|
788
|
+ var member = connection.emuc.members[jid];
|
|
789
|
+ if (member.role === 'moderator') {
|
|
790
|
+ var moderatorId
|
|
791
|
+ = 'participant_' + Strophe.getResourceFromJid(jid);
|
|
792
|
+
|
|
793
|
+ var moderatorContainer
|
|
794
|
+ = document.getElementById(moderatorId);
|
|
795
|
+
|
|
796
|
+ if (Strophe.getResourceFromJid(jid) === 'focus') {
|
|
797
|
+ // Skip server side focus
|
|
798
|
+ return;
|
|
799
|
+ }
|
|
800
|
+ if (!moderatorContainer) {
|
|
801
|
+ console.error("No moderator container for " + jid);
|
|
802
|
+ return;
|
|
803
|
+ }
|
|
804
|
+ var indicatorSpan
|
|
805
|
+ = $('#' + moderatorId + ' .focusindicator');
|
802
|
806
|
|
803
|
|
- if (!indicatorSpan || indicatorSpan.length === 0) {
|
804
|
|
- indicatorSpan = document.createElement('span');
|
805
|
|
- indicatorSpan.className = 'focusindicator';
|
|
807
|
+ if (!indicatorSpan || indicatorSpan.length === 0) {
|
|
808
|
+ indicatorSpan = document.createElement('span');
|
|
809
|
+ indicatorSpan.className = 'focusindicator';
|
806
|
810
|
|
807
|
|
- focusContainer.appendChild(indicatorSpan);
|
|
811
|
+ moderatorContainer.appendChild(indicatorSpan);
|
808
|
812
|
|
809
|
|
- createFocusIndicatorElement(indicatorSpan);
|
810
|
|
- }
|
|
813
|
+ createModeratorIndicatorElement(indicatorSpan);
|
|
814
|
+ }
|
|
815
|
+ }
|
|
816
|
+ });
|
811
|
817
|
}
|
812
|
818
|
};
|
813
|
819
|
|
|
@@ -1120,15 +1126,15 @@ var VideoLayout = (function (my) {
|
1120
|
1126
|
}
|
1121
|
1127
|
|
1122
|
1128
|
/**
|
1123
|
|
- * Creates the element indicating the focus of the conference.
|
|
1129
|
+ * Creates the element indicating the moderator(owner) of the conference.
|
1124
|
1130
|
*
|
1125
|
|
- * @param parentElement the parent element where the focus indicator will
|
|
1131
|
+ * @param parentElement the parent element where the owner indicator will
|
1126
|
1132
|
* be added
|
1127
|
1133
|
*/
|
1128
|
|
- function createFocusIndicatorElement(parentElement) {
|
1129
|
|
- var focusIndicator = document.createElement('i');
|
1130
|
|
- focusIndicator.className = 'fa fa-star';
|
1131
|
|
- parentElement.appendChild(focusIndicator);
|
|
1134
|
+ function createModeratorIndicatorElement(parentElement) {
|
|
1135
|
+ var moderatorIndicator = document.createElement('i');
|
|
1136
|
+ moderatorIndicator.className = 'fa fa-star';
|
|
1137
|
+ parentElement.appendChild(moderatorIndicator);
|
1132
|
1138
|
|
1133
|
1139
|
Util.setTooltip(parentElement,
|
1134
|
1140
|
"The owner of<br/>this conference",
|
|
@@ -1328,19 +1334,28 @@ var VideoLayout = (function (my) {
|
1328
|
1334
|
* On audio muted event.
|
1329
|
1335
|
*/
|
1330
|
1336
|
$(document).bind('audiomuted.muc', function (event, jid, isMuted) {
|
|
1337
|
+ /*
|
|
1338
|
+ // FIXME: but focus can not mute in this case ? - check
|
1331
|
1339
|
if (jid === connection.emuc.myroomjid) {
|
|
1340
|
+
|
1332
|
1341
|
// The local mute indicator is controlled locally
|
1333
|
1342
|
return;
|
|
1343
|
+ }*/
|
|
1344
|
+ var videoSpanId = null;
|
|
1345
|
+ if (jid === connection.emuc.myroomjid) {
|
|
1346
|
+ videoSpanId = 'localVideoContainer';
|
|
1347
|
+ } else {
|
|
1348
|
+ VideoLayout.ensurePeerContainerExists(jid);
|
|
1349
|
+ videoSpanId = 'participant_' + Strophe.getResourceFromJid(jid);
|
1334
|
1350
|
}
|
1335
|
1351
|
|
1336
|
1352
|
VideoLayout.ensurePeerContainerExists(jid);
|
1337
|
1353
|
|
1338
|
|
- if (focus) {
|
|
1354
|
+ if (Moderator.isModerator()) {
|
1339
|
1355
|
mutedAudios[jid] = isMuted;
|
1340
|
1356
|
VideoLayout.updateRemoteVideoMenu(jid, isMuted);
|
1341
|
1357
|
}
|
1342
|
1358
|
|
1343
|
|
- var videoSpanId = 'participant_' + Strophe.getResourceFromJid(jid);
|
1344
|
1359
|
if (videoSpanId)
|
1345
|
1360
|
VideoLayout.showAudioIndicator(videoSpanId, isMuted);
|
1346
|
1361
|
});
|
|
@@ -1614,7 +1629,7 @@ var VideoLayout = (function (my) {
|
1614
|
1629
|
VideoLayout.updateLargeVideo(videoelem.attr('src'), 1);
|
1615
|
1630
|
}
|
1616
|
1631
|
|
1617
|
|
- VideoLayout.showFocusIndicator();
|
|
1632
|
+ VideoLayout.showModeratorIndicator();
|
1618
|
1633
|
}
|
1619
|
1634
|
});
|
1620
|
1635
|
|