Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

ref(toolbar): remove all jquery filmstrip animations

Leonard Kim8363f3cfeb17
diff --git a/modules/UI/videolayout/Filmstrip.js b/modules/UI/videolayout/Filmstrip.js
index abf18ef719..a12c69d633 100644
--- a/modules/UI/videolayout/Filmstrip.js
+++ b/modules/UI/videolayout/Filmstrip.js
@@ -442,81 +442,53 @@ const Filmstrip = {
* @param forceUpdate
* @returns {Promise}
*/
- // eslint-disable-next-line max-params
+ // eslint-disable-next-line max-params, no-unused-vars
resizeThumbnails(local, remote, animate = false, forceUpdate = false) {
- return new Promise(resolve => {
- const thumbs = this.getThumbs(!forceUpdate);
- const promises = [];
-
- if (thumbs.localThumb) {
- // eslint-disable-next-line no-shadow
- thumbs.localThumb.css({
- display: 'inline-block',
- height: `${local.thumbHeight}px`,
- 'min-height': `${local.thumbHeight}px`,
- 'min-width': `${local.thumbWidth}px`,
- width: `${local.thumbWidth}px`
- });
- }
+ const thumbs = this.getThumbs(!forceUpdate);
- if (thumbs.remoteThumbs) {
- thumbs.remoteThumbs.css({
- display: 'inline-block',
- height: `${remote.thumbHeight}px`,
- 'min-height': `${remote.thumbHeight}px`,
- 'min-width': `${remote.thumbWidth}px`,
- width: `${remote.thumbWidth}px`
- });
- }
+ if (thumbs.localThumb) {
// eslint-disable-next-line no-shadow
- promises.push(new Promise(resolve => {
- // Let CSS take care of height in vertical filmstrip mode.
- if (interfaceConfig.VERTICAL_FILMSTRIP) {
- $('#filmstripLocalVideo').animate({
- // adds 4 px because of small video 2px border
- width: local.thumbWidth + 4
- }, this._getAnimateOptions(animate, resolve));
- } else {
- this.filmstrip.animate({
- // adds 4 px because of small video 2px border
- height: remote.thumbHeight + 4
- }, this._getAnimateOptions(animate, resolve));
- }
- }));
+ thumbs.localThumb.css({
+ display: 'inline-block',
+ height: `${local.thumbHeight}px`,
+ 'min-height': `${local.thumbHeight}px`,
+ 'min-width': `${local.thumbWidth}px`,
+ width: `${local.thumbWidth}px`
+ });
+ }
- promises.push(new Promise(() => {
- const { localThumb } = this.getThumbs();
- const height = localThumb ? localThumb.height() : 0;
- const fontSize = UIUtil.getIndicatorFontSize(height);
+ if (thumbs.remoteThumbs) {
+ thumbs.remoteThumbs.css({
+ display: 'inline-block',
+ height: `${remote.thumbHeight}px`,
+ 'min-height': `${remote.thumbHeight}px`,
+ 'min-width': `${remote.thumbWidth}px`,
+ width: `${remote.thumbWidth}px`
+ });
+ }
- this.filmstrip.find('.indicator').animate({
- fontSize
- }, this._getAnimateOptions(animate, resolve));
- }));
+ // Let CSS take care of height in vertical filmstrip mode.
+ if (interfaceConfig.VERTICAL_FILMSTRIP) {
+ $('#filmstripLocalVideo').css({
+ // adds 4 px because of small video 2px border
+ width: `${local.thumbWidth + 4}px`
+ });
+ } else {
+ this.filmstrip.css({
+ // adds 4 px because of small video 2px border
+ height: `${remote.thumbHeight + 4}px`
+ });
+ }
- if (!animate) {
- resolve();
- }
+ const { localThumb } = this.getThumbs();
+ const height = localThumb ? localThumb.height() : 0;
+ const fontSize = UIUtil.getIndicatorFontSize(height);
- Promise.all(promises).then(resolve);
+ this.filmstrip.find('.indicator').css({
+ 'font-size': `${fontSize}px`
});
},
- /**
- * Helper method. Returns options for jQuery animation
- * @param animate {Boolean} - animation flag
- * @param cb {Function} - complete callback
- * @returns {Object} - animation options object
- * @private
- */
- _getAnimateOptions(animate, cb = $.noop) {
- return {
- queue: false,
- duration: animate ? 500 : 0,
- complete: cb
- };
- },
-
/**
* Returns thumbnails of the filmstrip
* @param onlyVisible
diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.js
index 857fefadca..f3723b7596 100644
--- a/modules/UI/videolayout/VideoLayout.js
+++ b/modules/UI/videolayout/VideoLayout.js
@@ -582,12 +582,11 @@ const VideoLayout = {
= Filmstrip.calculateThumbnailSize();
Filmstrip.resizeThumbnails(localVideo, remoteVideo,
- animate, forceUpdate)
- .then(() => {
- if (onComplete && typeof onComplete === 'function') {
- onComplete();
- }
- });
+ animate, forceUpdate);
+
+ if (onComplete && typeof onComplete === 'function') {
+ onComplete();
+ }
return { localVideo,
remoteVideo };