|
|
|
@ -380,11 +380,12 @@ var VideoLayout = (function (my) { |
|
|
|
|
var videoSpanId = 'participant_' + resourceJid; |
|
|
|
|
|
|
|
|
|
if ($('#' + videoSpanId).length > 0) { |
|
|
|
|
// If there's been a focus change, make sure we add focus related
|
|
|
|
|
// interface!!
|
|
|
|
|
if (focus && $('#remote_popupmenu_' + resourceJid).length <= 0) |
|
|
|
|
addRemoteVideoMenu( peerJid, |
|
|
|
|
document.getElementById(videoSpanId)); |
|
|
|
|
// If there's been a moderator change, make sure we add moderator
|
|
|
|
|
// related interface!!
|
|
|
|
|
if (Moderator.isModerator() && |
|
|
|
|
$('#remote_popupmenu_' + resourceJid).length <= 0) |
|
|
|
|
addRemoteVideoMenu(peerJid, |
|
|
|
|
document.getElementById(videoSpanId)); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
var container |
|
|
|
@ -419,7 +420,7 @@ var VideoLayout = (function (my) { |
|
|
|
|
|
|
|
|
|
// If the peerJid is null then this video span couldn't be directly
|
|
|
|
|
// associated with a participant (this could happen in the case of prezi).
|
|
|
|
|
if (focus && peerJid != null) |
|
|
|
|
if (Moderator.isModerator() && peerJid !== null) |
|
|
|
|
addRemoteVideoMenu(peerJid, container); |
|
|
|
|
|
|
|
|
|
remotes.appendChild(container); |
|
|
|
@ -772,42 +773,47 @@ var VideoLayout = (function (my) { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Shows a visual indicator for the focus of the conference. |
|
|
|
|
* Currently if we're not the owner of the conference we obtain the focus |
|
|
|
|
* from the connection.jingle.sessions. |
|
|
|
|
* Shows a visual indicator for the moderator of the conference. |
|
|
|
|
*/ |
|
|
|
|
my.showFocusIndicator = function() { |
|
|
|
|
if (focus !== null) { |
|
|
|
|
my.showModeratorIndicator = function () { |
|
|
|
|
if (Moderator.isModerator()) { |
|
|
|
|
var indicatorSpan = $('#localVideoContainer .focusindicator'); |
|
|
|
|
|
|
|
|
|
if (indicatorSpan.children().length === 0) |
|
|
|
|
{ |
|
|
|
|
createFocusIndicatorElement(indicatorSpan[0]); |
|
|
|
|
createModeratorIndicatorElement(indicatorSpan[0]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (Object.keys(connection.jingle.sessions).length > 0) { |
|
|
|
|
// If we're only a participant the focus will be the only session we have.
|
|
|
|
|
var session |
|
|
|
|
= connection.jingle.sessions |
|
|
|
|
[Object.keys(connection.jingle.sessions)[0]]; |
|
|
|
|
var focusId |
|
|
|
|
= 'participant_' + Strophe.getResourceFromJid(session.peerjid); |
|
|
|
|
|
|
|
|
|
var focusContainer = document.getElementById(focusId); |
|
|
|
|
if (!focusContainer) { |
|
|
|
|
console.error("No focus container!"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
var indicatorSpan = $('#' + focusId + ' .focusindicator'); |
|
|
|
|
} else { |
|
|
|
|
Object.keys(connection.emuc.members).forEach(function (jid) { |
|
|
|
|
var member = connection.emuc.members[jid]; |
|
|
|
|
if (member.role === 'moderator') { |
|
|
|
|
var moderatorId |
|
|
|
|
= 'participant_' + Strophe.getResourceFromJid(jid); |
|
|
|
|
|
|
|
|
|
var moderatorContainer |
|
|
|
|
= document.getElementById(moderatorId); |
|
|
|
|
|
|
|
|
|
if (Strophe.getResourceFromJid(jid) === 'focus') { |
|
|
|
|
// Skip server side focus
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (!moderatorContainer) { |
|
|
|
|
console.error("No moderator container for " + jid); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
var indicatorSpan |
|
|
|
|
= $('#' + moderatorId + ' .focusindicator'); |
|
|
|
|
|
|
|
|
|
if (!indicatorSpan || indicatorSpan.length === 0) { |
|
|
|
|
indicatorSpan = document.createElement('span'); |
|
|
|
|
indicatorSpan.className = 'focusindicator'; |
|
|
|
|
if (!indicatorSpan || indicatorSpan.length === 0) { |
|
|
|
|
indicatorSpan = document.createElement('span'); |
|
|
|
|
indicatorSpan.className = 'focusindicator'; |
|
|
|
|
|
|
|
|
|
focusContainer.appendChild(indicatorSpan); |
|
|
|
|
moderatorContainer.appendChild(indicatorSpan); |
|
|
|
|
|
|
|
|
|
createFocusIndicatorElement(indicatorSpan); |
|
|
|
|
} |
|
|
|
|
createModeratorIndicatorElement(indicatorSpan); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -1120,15 +1126,15 @@ var VideoLayout = (function (my) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Creates the element indicating the focus of the conference. |
|
|
|
|
* Creates the element indicating the moderator(owner) of the conference. |
|
|
|
|
* |
|
|
|
|
* @param parentElement the parent element where the focus indicator will |
|
|
|
|
* @param parentElement the parent element where the owner indicator will |
|
|
|
|
* be added |
|
|
|
|
*/ |
|
|
|
|
function createFocusIndicatorElement(parentElement) { |
|
|
|
|
var focusIndicator = document.createElement('i'); |
|
|
|
|
focusIndicator.className = 'fa fa-star'; |
|
|
|
|
parentElement.appendChild(focusIndicator); |
|
|
|
|
function createModeratorIndicatorElement(parentElement) { |
|
|
|
|
var moderatorIndicator = document.createElement('i'); |
|
|
|
|
moderatorIndicator.className = 'fa fa-star'; |
|
|
|
|
parentElement.appendChild(moderatorIndicator); |
|
|
|
|
|
|
|
|
|
Util.setTooltip(parentElement, |
|
|
|
|
"The owner of<br/>this conference", |
|
|
|
@ -1328,19 +1334,28 @@ var VideoLayout = (function (my) { |
|
|
|
|
* On audio muted event. |
|
|
|
|
*/ |
|
|
|
|
$(document).bind('audiomuted.muc', function (event, jid, isMuted) { |
|
|
|
|
/* |
|
|
|
|
// FIXME: but focus can not mute in this case ? - check
|
|
|
|
|
if (jid === connection.emuc.myroomjid) { |
|
|
|
|
|
|
|
|
|
// The local mute indicator is controlled locally
|
|
|
|
|
return; |
|
|
|
|
}*/ |
|
|
|
|
var videoSpanId = null; |
|
|
|
|
if (jid === connection.emuc.myroomjid) { |
|
|
|
|
videoSpanId = 'localVideoContainer'; |
|
|
|
|
} else { |
|
|
|
|
VideoLayout.ensurePeerContainerExists(jid); |
|
|
|
|
videoSpanId = 'participant_' + Strophe.getResourceFromJid(jid); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
VideoLayout.ensurePeerContainerExists(jid); |
|
|
|
|
|
|
|
|
|
if (focus) { |
|
|
|
|
if (Moderator.isModerator()) { |
|
|
|
|
mutedAudios[jid] = isMuted; |
|
|
|
|
VideoLayout.updateRemoteVideoMenu(jid, isMuted); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var videoSpanId = 'participant_' + Strophe.getResourceFromJid(jid); |
|
|
|
|
if (videoSpanId) |
|
|
|
|
VideoLayout.showAudioIndicator(videoSpanId, isMuted); |
|
|
|
|
}); |
|
|
|
@ -1614,7 +1629,7 @@ var VideoLayout = (function (my) { |
|
|
|
|
VideoLayout.updateLargeVideo(videoelem.attr('src'), 1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
VideoLayout.showFocusIndicator(); |
|
|
|
|
VideoLayout.showModeratorIndicator(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|