Rename classname; Refactor click on video method

This commit is contained in:
Ilya Daynatovich 2016-11-03 12:13:03 +02:00
parent d703271c96
commit 30e717bd20
4 changed files with 9 additions and 18 deletions

View File

@ -44,7 +44,7 @@
position: relative;
text-align: center;
&__wrapper {
&__background {
@include topLeft();
width: 100%;
height: 100%;

View File

@ -169,7 +169,7 @@
<div id="remoteVideos">
<span id="localVideoContainer" class="videocontainer videocontainer_small">
<div class="videocontainer__wrapper"></div>
<div class="videocontainer__background"></div>
<span id="localVideoWrapper">
<!--<video id="localVideo" autoplay muted></video> - is now per stream generated -->
</span>

View File

@ -819,23 +819,14 @@ UI.emitEvent = function (type, options) {
};
UI.clickOnVideo = function (videoNumber) {
let videos = $("#remoteVideos .videocontainer:not(#mixedstream)").toArray();
let videos = $("#remoteVideos .videocontainer:not(#mixedstream)");
let videosLength = videos.length;
// Separate remotes from local videocontainer and reverse order of
// remote ones
let videosMap = videos.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();
if(videosLength <= videoNumber) {
return;
}
let videoIndex = videoNumber === 0 ? 0 : videosLength - videoNumber;
videos[videoIndex].click();
};
//Used by torture

View File

@ -632,7 +632,7 @@ RemoteVideo.createContainer = function (spanId) {
container.className = 'videocontainer';
let wrapper = document.createElement('div');
wrapper.className = 'videocontainer__wrapper';
wrapper.className = 'videocontainer__background';
container.appendChild(wrapper);
let indicatorBar = document.createElement('div');