]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/videojs-components/theater-button.ts
Fix For GitPod
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / videojs-components / theater-button.ts
index 1e11a95466be63c640e6ee59b144e8fef7119463..bf383cf34827392a98f1a2a41f844e82869e7907 100644 (file)
@@ -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 () {