Merge pull request #115 from fouksf/iss107
Changes the default display name.
This commit is contained in:
commit
360829c092
|
@ -1,6 +1,8 @@
|
||||||
var VideoLayout = (function (my) {
|
var VideoLayout = (function (my) {
|
||||||
var preMuted = false;
|
var preMuted = false;
|
||||||
var currentDominantSpeaker = null;
|
var currentDominantSpeaker = null;
|
||||||
|
var defaultRemoteDisplayName = "Fellow Jitster";
|
||||||
|
var defaultDominantSpeakerDisplayName = "Speaker";
|
||||||
var lastNCount = config.channelLastN;
|
var lastNCount = config.channelLastN;
|
||||||
var lastNEndpointsCache = [];
|
var lastNEndpointsCache = [];
|
||||||
var largeVideoNewSrc = '';
|
var largeVideoNewSrc = '';
|
||||||
|
@ -512,7 +514,6 @@ var VideoLayout = (function (my) {
|
||||||
function setDisplayName(videoSpanId, displayName) {
|
function setDisplayName(videoSpanId, displayName) {
|
||||||
var nameSpan = $('#' + videoSpanId + '>span.displayname');
|
var nameSpan = $('#' + videoSpanId + '>span.displayname');
|
||||||
var defaultLocalDisplayName = "Me";
|
var defaultLocalDisplayName = "Me";
|
||||||
var defaultRemoteDisplayName = "Speaker";
|
|
||||||
|
|
||||||
// If we already have a display name for this video.
|
// If we already have a display name for this video.
|
||||||
if (nameSpan.length > 0) {
|
if (nameSpan.length > 0) {
|
||||||
|
@ -1196,10 +1197,19 @@ var VideoLayout = (function (my) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Update the current dominant speaker.
|
// Update the current dominant speaker.
|
||||||
if (resourceJid !== currentDominantSpeaker)
|
if (resourceJid !== currentDominantSpeaker) {
|
||||||
|
var oldSpeakerVideoSpanId = "participant_" + currentDominantSpeaker,
|
||||||
|
newSpeakerVideoSpanId = "participant_" + resourceJid;
|
||||||
|
if($("#" + oldSpeakerVideoSpanId + ">span.displayname").text() === defaultDominantSpeakerDisplayName) {
|
||||||
|
setDisplayName(oldSpeakerVideoSpanId, null);
|
||||||
|
}
|
||||||
|
if($("#" + newSpeakerVideoSpanId + ">span.displayname").text() === defaultRemoteDisplayName) {
|
||||||
|
setDisplayName(newSpeakerVideoSpanId, defaultDominantSpeakerDisplayName);
|
||||||
|
}
|
||||||
currentDominantSpeaker = resourceJid;
|
currentDominantSpeaker = resourceJid;
|
||||||
else
|
} else {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Obtain container for new dominant speaker.
|
// Obtain container for new dominant speaker.
|
||||||
var container = document.getElementById(
|
var container = document.getElementById(
|
||||||
|
|
Loading…
Reference in New Issue