Explorar el Código

Rename classname; Refactor click on video method

j8
Ilya Daynatovich hace 8 años
padre
commit
30e717bd20
Se han modificado 4 ficheros con 10 adiciones y 19 borrados
  1. 1
    1
      css/_videolayout_default.scss
  2. 1
    1
      index.html
  3. 7
    16
      modules/UI/UI.js
  4. 1
    1
      modules/UI/videolayout/RemoteVideo.js

+ 1
- 1
css/_videolayout_default.scss Ver fichero

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

+ 1
- 1
index.html Ver fichero

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

+ 7
- 16
modules/UI/UI.js Ver fichero

@@ -819,23 +819,14 @@ UI.emitEvent = function (type, options) {
819 819
 };
820 820
 
821 821
 UI.clickOnVideo = function (videoNumber) {
822
-    let videos = $("#remoteVideos .videocontainer:not(#mixedstream)").toArray();
823
-
824
-    // Separate remotes from local videocontainer and reverse order of
825
-    // remote ones
826
-    let videosMap = videos.reduce((videoObj, video) => {
827
-              if(video.id === 'localVideoContainer') {
828
-                  videoObj.local = video;
829
-              } else {
830
-                  videoObj.remote.unshift(video);
831
-              }
832
-              return videoObj;
833
-          }, { local: null, remote: [] });
834
-
835
-    let sortedVideos = [videosMap.local, ...videosMap.remote];
836
-    if (sortedVideos.length > videoNumber) {
837
-        $(sortedVideos[videoNumber]).click();
822
+    let videos = $("#remoteVideos .videocontainer:not(#mixedstream)");
823
+    let videosLength = videos.length;
824
+
825
+    if(videosLength <= videoNumber) {
826
+        return;
838 827
     }
828
+    let videoIndex = videoNumber === 0 ? 0 : videosLength - videoNumber;
829
+    videos[videoIndex].click();
839 830
 };
840 831
 
841 832
 //Used by torture

+ 1
- 1
modules/UI/videolayout/RemoteVideo.js Ver fichero

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

Loading…
Cancelar
Guardar