From 3a149e9f8b2e99507c72792b80cee3a90df003b2 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 22 Nov 2019 11:43:17 +0100 Subject: Add audio only transcoding tests --- .../player/videojs-components/resolution-menu-button.ts | 6 +++++- client/src/assets/player/webtorrent/webtorrent-plugin.ts | 12 ++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'client') diff --git a/client/src/assets/player/videojs-components/resolution-menu-button.ts b/client/src/assets/player/videojs-components/resolution-menu-button.ts index 445b14b2b..86be03af7 100644 --- a/client/src/assets/player/videojs-components/resolution-menu-button.ts +++ b/client/src/assets/player/videojs-components/resolution-menu-button.ts @@ -75,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.id == 0 ? this.player .localize('Audio-only') : d.label, + label, selected: d.selected, callback: data.qualitySwitchCallback }) diff --git a/client/src/assets/player/webtorrent/webtorrent-plugin.ts b/client/src/assets/player/webtorrent/webtorrent-plugin.ts index 007fc58cc..8b5690cea 100644 --- a/client/src/assets/player/webtorrent/webtorrent-plugin.ts +++ b/client/src/assets/player/webtorrent/webtorrent-plugin.ts @@ -186,15 +186,15 @@ class WebTorrentPlugin extends Plugin { this.player.bigPlayButton.hide() } - // Audio-only (resolutionId == 0) gets special treatment - if (resolutionId > 0) { - // Hide poster to have black background - this.player.removeClass('vjs-playing-audio-only-content') - this.player.posterImage.hide() - } else { + // Audio-only (resolutionId === 0) gets special treatment + if (resolutionId === 0) { // Audio-only: show poster, do not auto-hide controls this.player.addClass('vjs-playing-audio-only-content') this.player.posterImage.show() + } else { + // Hide poster to have black background + this.player.removeClass('vjs-playing-audio-only-content') + this.player.posterImage.hide() } const newVideoFile = this.videoFiles.find(f => f.resolution.id === resolutionId) -- cgit v1.2.3