|
@@ -76,10 +76,6 @@ const Filmstrip = {
|
76
|
76
|
* @returns {{availableWidth: number, availableHeight: number}}
|
77
|
77
|
*/
|
78
|
78
|
calculateAvailableSize() {
|
79
|
|
- const state = APP.store.getState();
|
80
|
|
- const currentLayout = getCurrentLayout(state);
|
81
|
|
- const isHorizontalFilmstripView = currentLayout === LAYOUTS.HORIZONTAL_FILMSTRIP_VIEW;
|
82
|
|
-
|
83
|
79
|
/**
|
84
|
80
|
* If the videoAreaAvailableWidth is set we use this one to calculate
|
85
|
81
|
* the filmstrip width, because we're probably in a state where the
|
|
@@ -87,70 +83,31 @@ const Filmstrip = {
|
87
|
83
|
*/
|
88
|
84
|
const videoAreaAvailableWidth
|
89
|
85
|
= UIUtil.getAvailableVideoWidth()
|
90
|
|
- - this._getFilmstripExtraPanelsWidth()
|
91
|
|
- - UIUtil.parseCssInt(this.filmstrip.css('right'), 10)
|
92
|
|
- - UIUtil.parseCssInt(this.filmstrip.css('paddingLeft'), 10)
|
93
|
|
- - UIUtil.parseCssInt(this.filmstrip.css('paddingRight'), 10)
|
94
|
|
- - UIUtil.parseCssInt(this.filmstrip.css('borderLeftWidth'), 10)
|
95
|
|
- - UIUtil.parseCssInt(this.filmstrip.css('borderRightWidth'), 10)
|
96
|
|
- - 5;
|
97
|
|
-
|
98
|
|
- let availableHeight = interfaceConfig.FILM_STRIP_MAX_HEIGHT;
|
|
86
|
+ - this._getFilmstripExtraPanelsWidth()
|
|
87
|
+ - UIUtil.parseCssInt(this.filmstrip.css('right'), 10)
|
|
88
|
+ - UIUtil.parseCssInt(this.filmstrip.css('paddingLeft'), 10)
|
|
89
|
+ - UIUtil.parseCssInt(this.filmstrip.css('paddingRight'), 10)
|
|
90
|
+ - UIUtil.parseCssInt(this.filmstrip.css('borderLeftWidth'), 10)
|
|
91
|
+ - UIUtil.parseCssInt(this.filmstrip.css('borderRightWidth'), 10)
|
|
92
|
+ - 5;
|
|
93
|
+
|
|
94
|
+ const availableHeight = Math.min(interfaceConfig.FILM_STRIP_MAX_HEIGHT || 120, window.innerHeight - 18);
|
99
|
95
|
let availableWidth = videoAreaAvailableWidth;
|
100
|
|
- const thumbs = this.getThumbs(true);
|
|
96
|
+ const localVideoContainer = $('#localVideoContainer');
|
101
|
97
|
|
102
|
98
|
// If local thumb is not hidden
|
103
|
|
- if (thumbs.localThumb) {
|
104
|
|
- const localVideoContainer = $('#localVideoContainer');
|
105
|
|
-
|
|
99
|
+ if (!localVideoContainer.has('hidden')) {
|
106
|
100
|
availableWidth = Math.floor(
|
107
|
101
|
videoAreaAvailableWidth - (
|
108
|
|
- UIUtil.parseCssInt(
|
109
|
|
- localVideoContainer.css('borderLeftWidth'), 10)
|
110
|
|
- + UIUtil.parseCssInt(
|
111
|
|
- localVideoContainer.css('borderRightWidth'), 10)
|
112
|
|
- + UIUtil.parseCssInt(
|
113
|
|
- localVideoContainer.css('paddingLeft'), 10)
|
114
|
|
- + UIUtil.parseCssInt(
|
115
|
|
- localVideoContainer.css('paddingRight'), 10)
|
116
|
|
- + UIUtil.parseCssInt(
|
117
|
|
- localVideoContainer.css('marginLeft'), 10)
|
118
|
|
- + UIUtil.parseCssInt(
|
119
|
|
- localVideoContainer.css('marginRight'), 10))
|
|
102
|
+ UIUtil.parseCssInt(localVideoContainer.css('borderLeftWidth'), 10)
|
|
103
|
+ + UIUtil.parseCssInt(localVideoContainer.css('borderRightWidth'), 10)
|
|
104
|
+ + UIUtil.parseCssInt(localVideoContainer.css('paddingLeft'), 10)
|
|
105
|
+ + UIUtil.parseCssInt(localVideoContainer.css('paddingRight'), 10)
|
|
106
|
+ + UIUtil.parseCssInt(localVideoContainer.css('marginLeft'), 10)
|
|
107
|
+ + UIUtil.parseCssInt(localVideoContainer.css('marginRight'), 10))
|
120
|
108
|
);
|
121
|
109
|
}
|
122
|
110
|
|
123
|
|
- // If the number of videos is 0 or undefined or we're not in horizontal
|
124
|
|
- // filmstrip mode we don't need to calculate further any adjustments
|
125
|
|
- // to width based on the number of videos present.
|
126
|
|
- const numvids = thumbs.remoteThumbs.length;
|
127
|
|
-
|
128
|
|
- if (numvids && isHorizontalFilmstripView) {
|
129
|
|
- const remoteVideoContainer = thumbs.remoteThumbs.eq(0);
|
130
|
|
-
|
131
|
|
- availableWidth = Math.floor(
|
132
|
|
- videoAreaAvailableWidth - (numvids * (
|
133
|
|
- UIUtil.parseCssInt(
|
134
|
|
- remoteVideoContainer.css('borderLeftWidth'), 10)
|
135
|
|
- + UIUtil.parseCssInt(
|
136
|
|
- remoteVideoContainer.css('borderRightWidth'), 10)
|
137
|
|
- + UIUtil.parseCssInt(
|
138
|
|
- remoteVideoContainer.css('paddingLeft'), 10)
|
139
|
|
- + UIUtil.parseCssInt(
|
140
|
|
- remoteVideoContainer.css('paddingRight'), 10)
|
141
|
|
- + UIUtil.parseCssInt(
|
142
|
|
- remoteVideoContainer.css('marginLeft'), 10)
|
143
|
|
- + UIUtil.parseCssInt(
|
144
|
|
- remoteVideoContainer.css('marginRight'), 10)))
|
145
|
|
- );
|
146
|
|
- }
|
147
|
|
-
|
148
|
|
- // If the MAX_HEIGHT property hasn't been specified
|
149
|
|
- // we have the static value.
|
150
|
|
- const maxHeight = Math.min(interfaceConfig.FILM_STRIP_MAX_HEIGHT || 120, availableHeight);
|
151
|
|
-
|
152
|
|
- availableHeight = Math.min(maxHeight, window.innerHeight - 18);
|
153
|
|
-
|
154
|
111
|
return {
|
155
|
112
|
availableHeight,
|
156
|
113
|
availableWidth
|
|
@@ -231,10 +188,8 @@ const Filmstrip = {
|
231
|
188
|
* availableHeight/h > availableWidth/totalWidth otherwise 2) is true
|
232
|
189
|
*/
|
233
|
190
|
|
234
|
|
- const remoteThumbsInRow = interfaceConfig.VERTICAL_FILMSTRIP ? 0 : this.getThumbs(true).remoteThumbs.length;
|
235
|
191
|
const remoteLocalWidthRatio = interfaceConfig.REMOTE_THUMBNAIL_RATIO / interfaceConfig.LOCAL_THUMBNAIL_RATIO;
|
236
|
|
- const lW = Math.min(availableWidth / ((remoteLocalWidthRatio * remoteThumbsInRow) + 1),
|
237
|
|
- availableHeight * interfaceConfig.LOCAL_THUMBNAIL_RATIO);
|
|
192
|
+ const lW = Math.min(availableWidth, availableHeight * interfaceConfig.LOCAL_THUMBNAIL_RATIO);
|
238
|
193
|
const h = lW / interfaceConfig.LOCAL_THUMBNAIL_RATIO;
|
239
|
194
|
|
240
|
195
|
const remoteVideoWidth = lW * remoteLocalWidthRatio;
|
|
@@ -378,8 +333,8 @@ const Filmstrip = {
|
378
|
333
|
});
|
379
|
334
|
} else if (currentLayout === LAYOUTS.HORIZONTAL_FILMSTRIP_VIEW) {
|
380
|
335
|
this.filmstrip.css({
|
381
|
|
- // adds 4 px because of small video 2px border
|
382
|
|
- height: `${remote.thumbHeight + 4}px`
|
|
336
|
+ // adds 4 px because of small video 2px border and 10px margin for the scroll
|
|
337
|
+ height: `${remote.thumbHeight + 14}px`
|
383
|
338
|
});
|
384
|
339
|
}
|
385
|
340
|
|