Ilya Daynatovich пре 8 година
родитељ
комит
d3df082e3d
3 измењених фајлова са 31 додато и 7 уклоњено
  1. 1
    0
      css/_filmstrip.scss
  2. 1
    3
      modules/UI/util/UIUtil.js
  3. 29
    4
      modules/UI/videolayout/FilmStrip.js

+ 1
- 0
css/_filmstrip.scss Прегледај датотеку

50
         position:relative;
50
         position:relative;
51
         height:196px;
51
         height:196px;
52
         padding: 0;
52
         padding: 0;
53
+        padding-left: 17px;
53
         bottom: 0;
54
         bottom: 0;
54
         width:auto;
55
         width:auto;
55
         border: 2px solid transparent;
56
         border: 2px solid transparent;

+ 1
- 3
modules/UI/util/UIUtil.js Прегледај датотеку

27
      * Returns the available video width.
27
      * Returns the available video width.
28
      */
28
      */
29
     getAvailableVideoWidth: function () {
29
     getAvailableVideoWidth: function () {
30
-        let rightPanelWidth = 0;
31
-
32
-        return window.innerWidth - rightPanelWidth;
30
+        return window.innerWidth;
33
     },
31
     },
34
 
32
 
35
     /**
33
     /**

+ 29
- 4
modules/UI/videolayout/FilmStrip.js Прегледај датотеку

12
     init (eventEmitter) {
12
     init (eventEmitter) {
13
         this.iconMenuDownClassName = 'icon-menu-down';
13
         this.iconMenuDownClassName = 'icon-menu-down';
14
         this.iconMenuUpClassName = 'icon-menu-up';
14
         this.iconMenuUpClassName = 'icon-menu-up';
15
+        this.filmStripContainerClassName = 'filmstrip';
15
         this.filmStrip = $('#remoteVideos');
16
         this.filmStrip = $('#remoteVideos');
16
         this.eventEmitter = eventEmitter;
17
         this.eventEmitter = eventEmitter;
17
         this._initFilmStripToolbar();
18
         this._initFilmStripToolbar();
23
      */
24
      */
24
     _initFilmStripToolbar() {
25
     _initFilmStripToolbar() {
25
         let toolbar = this._generateFilmStripToolbar();
26
         let toolbar = this._generateFilmStripToolbar();
26
-        let container = document.querySelector('.filmstrip');
27
+        let className = this.filmStripContainerClassName;
28
+        let container = document.querySelector(`.${className}`);
27
 
29
 
28
         UIUtil.prependChild(container, toolbar);
30
         UIUtil.prependChild(container, toolbar);
29
 
31
 
203
          */
205
          */
204
         let videoAreaAvailableWidth
206
         let videoAreaAvailableWidth
205
             = UIUtil.getAvailableVideoWidth()
207
             = UIUtil.getAvailableVideoWidth()
208
+            - this.getFilmstripPanelsWidth()
206
             - UIUtil.parseCssInt(this.filmStrip.css('right'), 10)
209
             - UIUtil.parseCssInt(this.filmStrip.css('right'), 10)
207
             - UIUtil.parseCssInt(this.filmStrip.css('paddingLeft'), 10)
210
             - UIUtil.parseCssInt(this.filmStrip.css('paddingLeft'), 10)
208
             - UIUtil.parseCssInt(this.filmStrip.css('paddingRight'), 10)
211
             - UIUtil.parseCssInt(this.filmStrip.css('paddingRight'), 10)
265
     },
268
     },
266
 
269
 
267
     /**
270
     /**
268
-     * Calculate the thumbnail size in order to fit all the thumnails in passed
271
+     *
272
+     * Calculates width of all panels inside filmstrip
273
+     * @returns {number} width
274
+     */
275
+    getFilmstripPanelsWidth() {
276
+        let filmstripPanelsWidth = 0;
277
+        let className = this.filmStripContainerClassName;
278
+        $(`.${className}`)
279
+            .children()
280
+            .each(function () {
281
+                if (this.id !== 'remoteVideos') {
282
+                    filmstripPanelsWidth += $(this).outerWidth();
283
+                }
284
+            });
285
+
286
+        return filmstripPanelsWidth;
287
+    },
288
+
289
+    /**
290
+     Calculate the thumbnail size in order to fit all the thumnails in passed
269
      * dimensions.
291
      * dimensions.
270
      * NOTE: Here we assume that the remote and local thumbnails are with the
292
      * NOTE: Here we assume that the remote and local thumbnails are with the
271
      * same height.
293
      * same height.
272
      * @param {int} availableWidth the maximum width for all thumbnails
294
      * @param {int} availableWidth the maximum width for all thumbnails
273
      * @param {int} availableHeight the maximum height for all thumbnails
295
      * @param {int} availableHeight the maximum height for all thumbnails
296
+     * @returns {{localVideo, remoteVideo}}
274
      */
297
      */
275
     calculateThumbnailSizeFromAvailable(availableWidth, availableHeight) {
298
     calculateThumbnailSizeFromAvailable(availableWidth, availableHeight) {
276
         /**
299
         /**
317
             (remoteLocalWidthRatio * numberRemoteThumbs + 1), availableHeight *
340
             (remoteLocalWidthRatio * numberRemoteThumbs + 1), availableHeight *
318
             interfaceConfig.LOCAL_THUMBNAIL_RATIO);
341
             interfaceConfig.LOCAL_THUMBNAIL_RATIO);
319
         const h = lW / interfaceConfig.LOCAL_THUMBNAIL_RATIO;
342
         const h = lW / interfaceConfig.LOCAL_THUMBNAIL_RATIO;
320
-        return { localVideo:{
343
+        return {
344
+                    localVideo:{
321
                         thumbWidth: lW,
345
                         thumbWidth: lW,
322
                         thumbHeight: h
346
                         thumbHeight: h
323
-                    }, remoteVideo: {
347
+                    },
348
+                    remoteVideo: {
324
                         thumbWidth: lW * remoteLocalWidthRatio,
349
                         thumbWidth: lW * remoteLocalWidthRatio,
325
                         thumbHeight: h
350
                         thumbHeight: h
326
                     }
351
                     }

Loading…
Откажи
Сачувај