diff options
Diffstat (limited to 'client/src/assets')
-rw-r--r-- | client/src/assets/player/peertube-player-manager.ts | 9 |
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' | |||
19 | import './videojs-components/settings-panel-child' | 19 | import './videojs-components/settings-panel-child' |
20 | import './videojs-components/theater-button' | 20 | import './videojs-components/theater-button' |
21 | import videojs from 'video.js' | 21 | import videojs from 'video.js' |
22 | |||
22 | import { isDefaultLocale } from '../../../../shared/models/i18n/i18n' | 23 | import { isDefaultLocale } from '../../../../shared/models/i18n/i18n' |
23 | import { VideoFile } from '../../../../shared/models/videos' | 24 | import { VideoFile } from '../../../../shared/models/videos' |
24 | import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager' | 25 | import { 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 |