Fixes disapearing videos after a focus change. Fixes disapearing mute menu after a focus change.
This commit is contained in:
parent
8fb7c119ae
commit
96b7a3d3e1
20
app.js
20
app.js
|
@ -276,13 +276,9 @@ $(document).bind('remotestreamadded.jingle', function (event, data, sid) {
|
||||||
var remotes = document.getElementById('remoteVideos');
|
var remotes = document.getElementById('remoteVideos');
|
||||||
|
|
||||||
if (data.peerjid) {
|
if (data.peerjid) {
|
||||||
|
ensurePeerContainerExists(data.peerjid);
|
||||||
container = document.getElementById(
|
container = document.getElementById(
|
||||||
'participant_' + Strophe.getResourceFromJid(data.peerjid));
|
'participant_' + Strophe.getResourceFromJid(data.peerjid));
|
||||||
if (!container) {
|
|
||||||
console.error('no container for', data.peerjid);
|
|
||||||
} else {
|
|
||||||
//console.log('found container for', data.peerjid);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (data.stream.id !== 'mixedmslabel') {
|
if (data.stream.id !== 'mixedmslabel') {
|
||||||
console.error('can not associate stream', data.stream.id, 'with a participant');
|
console.error('can not associate stream', data.stream.id, 'with a participant');
|
||||||
|
@ -330,7 +326,7 @@ $(document).bind('remotestreamadded.jingle', function (event, data, sid) {
|
||||||
var audioCount = $('#' + container.id + '>audio').length;
|
var audioCount = $('#' + container.id + '>audio').length;
|
||||||
var videoCount = $('#' + container.id + '>video').length;
|
var videoCount = $('#' + container.id + '>video').length;
|
||||||
if (!audioCount && !videoCount) {
|
if (!audioCount && !videoCount) {
|
||||||
console.log("Remove whole user");
|
console.log("Remove whole user", container.id);
|
||||||
// Remove whole container
|
// Remove whole container
|
||||||
container.remove();
|
container.remove();
|
||||||
Util.playSoundNotification('userLeft');
|
Util.playSoundNotification('userLeft');
|
||||||
|
@ -1526,8 +1522,11 @@ function showFocusIndicator() {
|
||||||
}
|
}
|
||||||
else if (Object.keys(connection.jingle.sessions).length > 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.
|
// 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 session
|
||||||
var focusId = 'participant_' + Strophe.getResourceFromJid(session.peerjid);
|
= connection.jingle.sessions
|
||||||
|
[Object.keys(connection.jingle.sessions)[0]];
|
||||||
|
var focusId
|
||||||
|
= 'participant_' + Strophe.getResourceFromJid(session.peerjid);
|
||||||
var focusContainer = document.getElementById(focusId);
|
var focusContainer = document.getElementById(focusId);
|
||||||
if (!focusContainer) {
|
if (!focusContainer) {
|
||||||
console.error("No focus container!");
|
console.error("No focus container!");
|
||||||
|
@ -1554,6 +1553,11 @@ function ensurePeerContainerExists(peerJid) {
|
||||||
var videoSpanId = 'participant_' + peerResource;
|
var videoSpanId = 'participant_' + peerResource;
|
||||||
|
|
||||||
if ($('#' + videoSpanId).length > 0) {
|
if ($('#' + videoSpanId).length > 0) {
|
||||||
|
// If there's been a focus change, make sure we add focus related
|
||||||
|
// interface!!
|
||||||
|
if (focus && $('#remote_popupmenu_' + peerResource).length <= 0)
|
||||||
|
addRemoteVideoMenu( peerJid,
|
||||||
|
document.getElementById(videoSpanId));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue