|
|
@ -119,7 +119,8 @@ var VideoLayout = (function (my) { |
|
|
|
var newResourceJid; |
|
|
|
var newResourceJid; |
|
|
|
// We'll show user's avatar if he is the dominant speaker or if
|
|
|
|
// We'll show user's avatar if he is the dominant speaker or if
|
|
|
|
// his video thumbnail is pinned
|
|
|
|
// his video thumbnail is pinned
|
|
|
|
if (resourceJid === focusedVideoResourceJid || |
|
|
|
if (remoteVideos[resourceJid] && |
|
|
|
|
|
|
|
resourceJid === focusedVideoResourceJid || |
|
|
|
resourceJid === currentDominantSpeaker) { |
|
|
|
resourceJid === currentDominantSpeaker) { |
|
|
|
newResourceJid = resourceJid; |
|
|
|
newResourceJid = resourceJid; |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -137,18 +138,20 @@ var VideoLayout = (function (my) { |
|
|
|
var videoElem = RTC.getVideoElementName(); |
|
|
|
var videoElem = RTC.getVideoElementName(); |
|
|
|
var pick = $('#remoteVideos>span[id!="mixedstream"]:visible:last>' + videoElem); |
|
|
|
var pick = $('#remoteVideos>span[id!="mixedstream"]:visible:last>' + videoElem); |
|
|
|
if (pick.length && APP.RTC.getVideoSrc(pick[0])) { |
|
|
|
if (pick.length && APP.RTC.getVideoSrc(pick[0])) { |
|
|
|
return VideoLayout.getPeerContainerResourceJid(pick[0].parentNode); |
|
|
|
jid = VideoLayout.getPeerContainerResourceJid(pick[0].parentNode); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
console.info("Last visible video no longer exists"); |
|
|
|
console.info("Last visible video no longer exists"); |
|
|
|
pick = $('#remoteVideos>span[id!="mixedstream"]>' + videoElem); |
|
|
|
pick = $('#remoteVideos>span[id!="mixedstream"]>' + videoElem); |
|
|
|
if (pick.length && APP.RTC.getVideoSrc(pick[0])) { |
|
|
|
if (pick.length && APP.RTC.getVideoSrc(pick[0])) { |
|
|
|
return VideoLayout.getPeerContainerResourceJid(pick[0].parentNode); |
|
|
|
jid = VideoLayout.getPeerContainerResourceJid(pick[0].parentNode); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// Try local video
|
|
|
|
// Try local video
|
|
|
|
console.info("Fallback to local video..."); |
|
|
|
console.info("Fallback to local video..."); |
|
|
|
return APP.xmpp.myResource(); |
|
|
|
jid = APP.xmpp.myResource(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
console.info("electLastVisibleVideo: " + jid); |
|
|
|
|
|
|
|
return jid; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
my.onRemoteStreamAdded = function (stream) { |
|
|
|
my.onRemoteStreamAdded = function (stream) { |
|
|
@ -784,14 +787,6 @@ var VideoLayout = (function (my) { |
|
|
|
remoteVideos[resourceJid].updateStatsIndicator(percent, object); |
|
|
|
remoteVideos[resourceJid].updateStatsIndicator(percent, object); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Removes the connection |
|
|
|
|
|
|
|
* @param jid |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
my.removeConnectionIndicator = function (jid) { |
|
|
|
|
|
|
|
remoteVideos[Strophe.getResourceFromJid(jid)].removeConnectionIndicator(); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Hides the connection indicator |
|
|
|
* Hides the connection indicator |
|
|
|
* @param jid |
|
|
|
* @param jid |
|
|
@ -819,6 +814,23 @@ var VideoLayout = (function (my) { |
|
|
|
console.info("Focused video owner has left the conference"); |
|
|
|
console.info("Focused video owner has left the conference"); |
|
|
|
focusedVideoResourceJid = null; |
|
|
|
focusedVideoResourceJid = null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (currentDominantSpeaker === resourceJid) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
console.info("Dominant speaker has left the conference"); |
|
|
|
|
|
|
|
currentDominantSpeaker = null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var remoteVideo = remoteVideos[resourceJid]; |
|
|
|
|
|
|
|
if (remoteVideo) { |
|
|
|
|
|
|
|
remoteVideo.removeConnectionIndicator(); |
|
|
|
|
|
|
|
// Remove remote video
|
|
|
|
|
|
|
|
delete remoteVideos[resourceJid]; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
console.warn("No remote video for " + resourceJid); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VideoLayout.resizeThumbnails(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
my.onVideoTypeChanged = function (jid) { |
|
|
|
my.onVideoTypeChanged = function (jid) { |
|
|
|