aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/peertube-player-manager.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/assets/player/peertube-player-manager.ts')
-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