aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-11-22 11:43:17 +0100
committerChocobozzz <me@florianbigard.com>2019-11-25 10:59:49 +0100
commit3a149e9f8b2e99507c72792b80cee3a90df003b2 (patch)
treee12d6279f8a9cb3c3268aa7a006b22a85c42d034 /client
parent6ad88df896e359e428259ff511f6fca3675cb4af (diff)
downloadPeerTube-3a149e9f8b2e99507c72792b80cee3a90df003b2.tar.gz
PeerTube-3a149e9f8b2e99507c72792b80cee3a90df003b2.tar.zst
PeerTube-3a149e9f8b2e99507c72792b80cee3a90df003b2.zip
Add audio only transcoding tests
Diffstat (limited to 'client')
-rw-r--r--client/src/assets/player/videojs-components/resolution-menu-button.ts6
-rw-r--r--client/src/assets/player/webtorrent/webtorrent-plugin.ts12
2 files changed, 11 insertions, 7 deletions
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 {
75 // Skip auto resolution, we'll add it ourselves 75 // Skip auto resolution, we'll add it ourselves
76 if (d.id === -1) continue 76 if (d.id === -1) continue
77 77
78 const label = d.id === 0
79 ? this.player.localize('Audio-only')
80 : d.label
81
78 this.menu.addChild(new ResolutionMenuItem( 82 this.menu.addChild(new ResolutionMenuItem(
79 this.player_, 83 this.player_,
80 { 84 {
81 id: d.id, 85 id: d.id,
82 label: d.id == 0 ? this.player .localize('Audio-only') : d.label, 86 label,
83 selected: d.selected, 87 selected: d.selected,
84 callback: data.qualitySwitchCallback 88 callback: data.qualitySwitchCallback
85 }) 89 })
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 {
186 this.player.bigPlayButton.hide() 186 this.player.bigPlayButton.hide()
187 } 187 }
188 188
189 // Audio-only (resolutionId == 0) gets special treatment 189 // Audio-only (resolutionId === 0) gets special treatment
190 if (resolutionId > 0) { 190 if (resolutionId === 0) {
191 // Hide poster to have black background
192 this.player.removeClass('vjs-playing-audio-only-content')
193 this.player.posterImage.hide()
194 } else {
195 // Audio-only: show poster, do not auto-hide controls 191 // Audio-only: show poster, do not auto-hide controls
196 this.player.addClass('vjs-playing-audio-only-content') 192 this.player.addClass('vjs-playing-audio-only-content')
197 this.player.posterImage.show() 193 this.player.posterImage.show()
194 } else {
195 // Hide poster to have black background
196 this.player.removeClass('vjs-playing-audio-only-content')
197 this.player.posterImage.hide()
198 } 198 }
199 199
200 const newVideoFile = this.videoFiles.find(f => f.resolution.id === resolutionId) 200 const newVideoFile = this.videoFiles.find(f => f.resolution.id === resolutionId)