From 48d20e338bfecf72d826ab9d0d7a3db8e1e3ace5 Mon Sep 17 00:00:00 2001 From: Adam Butterworth Date: Fri, 24 Jan 2020 14:59:49 -0500 Subject: [PATCH] fix: video fullscreen must not assume resizer exists (#22935) Otherwise it fails to go fullscreen before playback --- .../xmodule/js/src/video/04_video_full_screen.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/video/04_video_full_screen.js b/common/lib/xmodule/xmodule/js/src/video/04_video_full_screen.js index c8d1741e19..1737662c84 100644 --- a/common/lib/xmodule/xmodule/js/src/video/04_video_full_screen.js +++ b/common/lib/xmodule/xmodule/js/src/video/04_video_full_screen.js @@ -188,8 +188,9 @@ .addClass('fa-arrows-alt'); $(closedCaptionsEl).css({top: '70%', left: '5%'}); - - this.resizer.delta.reset().setMode('width'); + if (this.resizer) { + this.resizer.delta.reset().setMode('width'); + } this.el.trigger('fullscreen', [this.isFullScreen]); } @@ -210,8 +211,9 @@ .addClass('fa-compress'); $(closedCaptionsEl).css({top: '70%', left: '5%'}); - - this.resizer.delta.substract(this.videoFullScreen.updateControlsHeight(), 'height').setMode('both'); + if (this.resizer) { + this.resizer.delta.substract(this.videoFullScreen.updateControlsHeight(), 'height').setMode('both'); + } this.el.trigger('fullscreen', [this.isFullScreen]); }