]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/videojs-components/resolution-menu-button.ts
Fix For GitPod
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / videojs-components / resolution-menu-button.ts
index abcc16411df0b7727d821947b515316cd074137e..86be03af761deb5a8b69587fc0cc520d1f595330 100644 (file)
@@ -9,6 +9,8 @@ const Menu: VideoJSComponentInterface = videojsUntyped.getComponent('Menu')
 const MenuButton: VideoJSComponentInterface = videojsUntyped.getComponent('MenuButton')
 class ResolutionMenuButton extends MenuButton {
   label: HTMLElement
+  labelEl_: any
+  player: Player
 
   constructor (player: Player, options: any) {
     super(player, options)
@@ -49,7 +51,7 @@ class ResolutionMenuButton extends MenuButton {
 
   private addClickListener (component: any) {
     component.on('click', () => {
-      let children = this.menu.children()
+      const children = this.menu.children()
 
       for (const child of children) {
         if (component !== child) {
@@ -73,11 +75,15 @@ class ResolutionMenuButton extends MenuButton {
       // Skip auto resolution, we'll add it ourselves
       if (d.id === -1) continue
 
+      const label = d.id === 0
+        ? this.player.localize('Audio-only')
+        : d.label
+
       this.menu.addChild(new ResolutionMenuItem(
         this.player_,
         {
           id: d.id,
-          label: d.label,
+          label,
           selected: d.selected,
           callback: data.qualitySwitchCallback
         })