From 9a18a6252071cf21b18f82a24bb63078abb75bc1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 18 Mar 2019 10:26:53 +0100 Subject: Handle theater mode for playlists --- client/src/assets/player/videojs-components/theater-button.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'client/src/assets/player/videojs-components') diff --git a/client/src/assets/player/videojs-components/theater-button.ts b/client/src/assets/player/videojs-components/theater-button.ts index 1e11a9546..bf383cf34 100644 --- a/client/src/assets/player/videojs-components/theater-button.ts +++ b/client/src/assets/player/videojs-components/theater-button.ts @@ -16,8 +16,11 @@ class TheaterButton extends Button { const enabled = getStoredTheater() if (enabled === true) { this.player_.addClass(TheaterButton.THEATER_MODE_CLASS) + this.handleTheaterChange() } + + this.player_.theaterEnabled = enabled } buildCSSClass () { @@ -25,13 +28,17 @@ class TheaterButton extends Button { } handleTheaterChange () { - if (this.isTheaterEnabled()) { + const theaterEnabled = this.isTheaterEnabled() + + if (theaterEnabled) { this.controlText('Normal mode') } else { this.controlText('Theater mode') } - saveTheaterInStore(this.isTheaterEnabled()) + saveTheaterInStore(theaterEnabled) + + this.player_.trigger('theaterChange', theaterEnabled) } handleClick () { -- cgit v1.2.3