Fixes returning to dominant speaker after closing shared video. Renames a method and fix its behaviour was handling both case when removing just video element in small videos (local or remote) and when we are removingParticipantContainer, now just handles the second one and uses focusedID if any or dominantSpeakerID if any, otherwise elects new video.
This commit is contained in:
parent
e330dbf5d1
commit
94d98ec0ab
modules/UI
|
@ -383,7 +383,7 @@ SharedVideoThumb.prototype.remove = function () {
|
||||||
|
|
||||||
// Make sure that the large video is updated if are removing its
|
// Make sure that the large video is updated if are removing its
|
||||||
// corresponding small video.
|
// corresponding small video.
|
||||||
this.VideoLayout.updateRemovedVideo(this.id);
|
this.VideoLayout.updateAfterThumbRemoved(this.id);
|
||||||
|
|
||||||
// Remove whole container
|
// Remove whole container
|
||||||
if (this.container.parentNode) {
|
if (this.container.parentNode) {
|
||||||
|
|
|
@ -191,7 +191,10 @@ LocalVideo.prototype.changeVideo = function (stream) {
|
||||||
|
|
||||||
let endedHandler = () => {
|
let endedHandler = () => {
|
||||||
localVideoContainer.removeChild(localVideo);
|
localVideoContainer.removeChild(localVideo);
|
||||||
this.VideoLayout.updateRemovedVideo(this.id);
|
// when removing only the video element and we are on stage
|
||||||
|
// update the stage
|
||||||
|
if(this.VideoLayout.isCurrentlyOnLarge(this.id))
|
||||||
|
this.VideoLayout.updateLargeVideo(this.id);
|
||||||
stream.off(TrackEvents.LOCAL_TRACK_STOPPED, endedHandler);
|
stream.off(TrackEvents.LOCAL_TRACK_STOPPED, endedHandler);
|
||||||
};
|
};
|
||||||
stream.on(TrackEvents.LOCAL_TRACK_STOPPED, endedHandler);
|
stream.on(TrackEvents.LOCAL_TRACK_STOPPED, endedHandler);
|
||||||
|
|
|
@ -156,8 +156,10 @@ RemoteVideo.prototype.removeRemoteStreamElement = function (stream) {
|
||||||
console.info((isVideo ? "Video" : "Audio") +
|
console.info((isVideo ? "Video" : "Audio") +
|
||||||
" removed " + this.id, select);
|
" removed " + this.id, select);
|
||||||
|
|
||||||
if (isVideo)
|
// when removing only the video element and we are on stage
|
||||||
this.VideoLayout.updateRemovedVideo(this.id);
|
// update the stage
|
||||||
|
if (isVideo && this.VideoLayout.isCurrentlyOnLarge(this.id))
|
||||||
|
this.VideoLayout.updateLargeVideo(this.id);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -168,7 +170,7 @@ RemoteVideo.prototype.remove = function () {
|
||||||
this.removeConnectionIndicator();
|
this.removeConnectionIndicator();
|
||||||
// Make sure that the large video is updated if are removing its
|
// Make sure that the large video is updated if are removing its
|
||||||
// corresponding small video.
|
// corresponding small video.
|
||||||
this.VideoLayout.updateRemovedVideo(this.id);
|
this.VideoLayout.updateAfterThumbRemoved(this.id);
|
||||||
// Remove whole container
|
// Remove whole container
|
||||||
if (this.container.parentNode) {
|
if (this.container.parentNode) {
|
||||||
this.container.parentNode.removeChild(this.container);
|
this.container.parentNode.removeChild(this.container);
|
||||||
|
|
|
@ -199,21 +199,21 @@ var VideoLayout = {
|
||||||
/**
|
/**
|
||||||
* Checks if removed video is currently displayed and tries to display
|
* Checks if removed video is currently displayed and tries to display
|
||||||
* another one instead.
|
* another one instead.
|
||||||
|
* Uses focusedID if any or dominantSpeakerID if any,
|
||||||
|
* otherwise elects new video, in this order.
|
||||||
*/
|
*/
|
||||||
updateRemovedVideo (id) {
|
updateAfterThumbRemoved (id) {
|
||||||
if (!this.isCurrentlyOnLarge(id)) {
|
if (!this.isCurrentlyOnLarge(id)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let newId;
|
let newId;
|
||||||
|
|
||||||
// We'll show user's avatar if he is the dominant speaker or if
|
if (pinnedId)
|
||||||
// his video thumbnail is pinned
|
newId = pinnedId;
|
||||||
if (remoteVideos[id] && (id === pinnedId
|
else if (currentDominantSpeaker)
|
||||||
|| id === currentDominantSpeaker)) {
|
newId = currentDominantSpeaker;
|
||||||
newId = id;
|
else // Otherwise select last visible video
|
||||||
} else {
|
|
||||||
// Otherwise select last visible video
|
|
||||||
newId = this.electLastVisibleVideo();
|
newId = this.electLastVisibleVideo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,8 +304,7 @@ var VideoLayout = {
|
||||||
*/
|
*/
|
||||||
handleVideoThumbClicked (id) {
|
handleVideoThumbClicked (id) {
|
||||||
if(pinnedId) {
|
if(pinnedId) {
|
||||||
var oldSmallVideo
|
var oldSmallVideo = VideoLayout.getSmallVideo(pinnedId);
|
||||||
= VideoLayout.getSmallVideo(pinnedId);
|
|
||||||
if (oldSmallVideo && !interfaceConfig.filmStripOnly)
|
if (oldSmallVideo && !interfaceConfig.filmStripOnly)
|
||||||
oldSmallVideo.focus(false);
|
oldSmallVideo.focus(false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue