Change order of remote videos when clicking on shortcut
This commit is contained in:
parent
f02f050e56
commit
c6c701330a
|
@ -819,9 +819,23 @@ UI.emitEvent = function (type, options) {
|
|||
};
|
||||
|
||||
UI.clickOnVideo = function (videoNumber) {
|
||||
var remoteVideos = $(".videocontainer:not(#mixedstream)");
|
||||
if (remoteVideos.length > videoNumber) {
|
||||
remoteVideos[videoNumber].click();
|
||||
let videos = $(".videocontainer:not(#mixedstream)").toArray();
|
||||
|
||||
// Remove large video container if matched and reverse order of
|
||||
// remote video containers
|
||||
let videosMap = videos.filter(el => el.id !== 'largeVideoContainer')
|
||||
.reduce((videoObj, video) => {
|
||||
if(video.id === 'localVideoContainer') {
|
||||
videoObj.local = video;
|
||||
} else {
|
||||
videoObj.remote.unshift(video);
|
||||
}
|
||||
return videoObj;
|
||||
}, { local: null, remote: [] });
|
||||
|
||||
let sortedVideos = [videosMap.local, ...videosMap.remote];
|
||||
if (sortedVideos.length > videoNumber) {
|
||||
$(sortedVideos[videoNumber]).click();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ var KeyboardShortcut = {
|
|||
_shortcuts[key].function(e);
|
||||
}
|
||||
else if (!isNaN(num) && num >= 0 && num <= 9) {
|
||||
APP.UI.clickOnVideo(num + 1);
|
||||
APP.UI.clickOnVideo(num);
|
||||
}
|
||||
//esc while the smileys are visible hides them
|
||||
} else if (key === "ESCAPE" &&
|
||||
|
|
Loading…
Reference in New Issue