|
@@ -12,6 +12,7 @@ const FilmStrip = {
|
12
|
12
|
init (eventEmitter) {
|
13
|
13
|
this.iconMenuDownClassName = 'icon-menu-down';
|
14
|
14
|
this.iconMenuUpClassName = 'icon-menu-up';
|
|
15
|
+ this.filmStripContainerClassName = 'filmstrip';
|
15
|
16
|
this.filmStrip = $('#remoteVideos');
|
16
|
17
|
this.eventEmitter = eventEmitter;
|
17
|
18
|
this._initFilmStripToolbar();
|
|
@@ -23,7 +24,8 @@ const FilmStrip = {
|
23
|
24
|
*/
|
24
|
25
|
_initFilmStripToolbar() {
|
25
|
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
|
30
|
UIUtil.prependChild(container, toolbar);
|
29
|
31
|
|
|
@@ -203,6 +205,7 @@ const FilmStrip = {
|
203
|
205
|
*/
|
204
|
206
|
let videoAreaAvailableWidth
|
205
|
207
|
= UIUtil.getAvailableVideoWidth()
|
|
208
|
+ - this.getFilmstripPanelsWidth()
|
206
|
209
|
- UIUtil.parseCssInt(this.filmStrip.css('right'), 10)
|
207
|
210
|
- UIUtil.parseCssInt(this.filmStrip.css('paddingLeft'), 10)
|
208
|
211
|
- UIUtil.parseCssInt(this.filmStrip.css('paddingRight'), 10)
|
|
@@ -265,12 +268,32 @@ const FilmStrip = {
|
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
|
291
|
* dimensions.
|
270
|
292
|
* NOTE: Here we assume that the remote and local thumbnails are with the
|
271
|
293
|
* same height.
|
272
|
294
|
* @param {int} availableWidth the maximum width for all thumbnails
|
273
|
295
|
* @param {int} availableHeight the maximum height for all thumbnails
|
|
296
|
+ * @returns {{localVideo, remoteVideo}}
|
274
|
297
|
*/
|
275
|
298
|
calculateThumbnailSizeFromAvailable(availableWidth, availableHeight) {
|
276
|
299
|
/**
|
|
@@ -317,10 +340,12 @@ const FilmStrip = {
|
317
|
340
|
(remoteLocalWidthRatio * numberRemoteThumbs + 1), availableHeight *
|
318
|
341
|
interfaceConfig.LOCAL_THUMBNAIL_RATIO);
|
319
|
342
|
const h = lW / interfaceConfig.LOCAL_THUMBNAIL_RATIO;
|
320
|
|
- return { localVideo:{
|
|
343
|
+ return {
|
|
344
|
+ localVideo:{
|
321
|
345
|
thumbWidth: lW,
|
322
|
346
|
thumbHeight: h
|
323
|
|
- }, remoteVideo: {
|
|
347
|
+ },
|
|
348
|
+ remoteVideo: {
|
324
|
349
|
thumbWidth: lW * remoteLocalWidthRatio,
|
325
|
350
|
thumbHeight: h
|
326
|
351
|
}
|