aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-03 16:03:52 +0200
committerChocobozzz <me@florianbigard.com>2020-08-03 16:03:52 +0200
commitdca0fe12ec2e47be51884c4eb05ebe6f358cb9de (patch)
tree19a9b5d905a6eaccda680b14e1b86b43577ca29d /client
parent2045b572233d1ee81fb1c14e33fc22b805cd7230 (diff)
downloadPeerTube-dca0fe12ec2e47be51884c4eb05ebe6f358cb9de.tar.gz
PeerTube-dca0fe12ec2e47be51884c4eb05ebe6f358cb9de.tar.zst
PeerTube-dca0fe12ec2e47be51884c4eb05ebe6f358cb9de.zip
Fix resolution for portrait videos
Diffstat (limited to 'client')
-rw-r--r--client/src/assets/player/peertube-player-manager.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts
index 7fa84e195..f12fb09ae 100644
--- a/client/src/assets/player/peertube-player-manager.ts
+++ b/client/src/assets/player/peertube-player-manager.ts
@@ -19,6 +19,7 @@ import './videojs-components/settings-panel'
19import './videojs-components/settings-panel-child' 19import './videojs-components/settings-panel-child'
20import './videojs-components/theater-button' 20import './videojs-components/theater-button'
21import videojs from 'video.js' 21import videojs from 'video.js'
22
22import { isDefaultLocale } from '../../../../shared/models/i18n/i18n' 23import { isDefaultLocale } from '../../../../shared/models/i18n/i18n'
23import { VideoFile } from '../../../../shared/models/videos' 24import { VideoFile } from '../../../../shared/models/videos'
24import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager' 25import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager'
@@ -300,7 +301,13 @@ export class PeertubePlayerManager {
300 } 301 }
301 const hlsjs = { 302 const hlsjs = {
302 levelLabelHandler: (level: { height: number, width: number }) => { 303 levelLabelHandler: (level: { height: number, width: number }) => {
303 const file = p2pMediaLoaderOptions.videoFiles.find(f => f.resolution.id === level.height) 304 const resolution = Math.min(level.height || 0, level.width || 0)
305
306 const file = p2pMediaLoaderOptions.videoFiles.find(f => f.resolution.id === resolution)
307 if (!file) {
308 console.error('Cannot find video file for level %d.', level.height)
309 return level.height
310 }
304 311
305 let label = file.resolution.label 312 let label = file.resolution.label
306 if (file.fps >= 50) label += file.fps 313 if (file.fps >= 50) label += file.fps