Rename classname; Refactor click on video method

pull/1095/head
Ilya Daynatovich 8 years ago
parent d703271c96
commit 30e717bd20
  1. 2
      css/_videolayout_default.scss
  2. 2
      index.html
  3. 23
      modules/UI/UI.js
  4. 2
      modules/UI/videolayout/RemoteVideo.js

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

@ -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>

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

@ -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');

Loading…
Cancel
Save