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.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts
index 6c8b13087..7be9f8719 100644
--- a/client/src/assets/player/peertube-player-manager.ts
+++ b/client/src/assets/player/peertube-player-manager.ts
@@ -17,6 +17,7 @@ import { buildVideoEmbed, buildVideoLink, copyToClipboard, getRtcConfig } from '
17import { getCompleteLocale, getShortLocale, is18nLocale, isDefaultLocale } from '../../../../shared/models/i18n/i18n' 17import { getCompleteLocale, getShortLocale, is18nLocale, isDefaultLocale } from '../../../../shared/models/i18n/i18n'
18import { segmentValidatorFactory } from './p2p-media-loader/segment-validator' 18import { segmentValidatorFactory } from './p2p-media-loader/segment-validator'
19import { segmentUrlBuilderFactory } from './p2p-media-loader/segment-url-builder' 19import { segmentUrlBuilderFactory } from './p2p-media-loader/segment-url-builder'
20import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager'
20 21
21// Change 'Playback Rate' to 'Speed' (smaller for our settings menu) 22// Change 'Playback Rate' to 'Speed' (smaller for our settings menu)
22videojsUntyped.getComponent('PlaybackRateMenuButton').prototype.controlText_ = 'Speed' 23videojsUntyped.getComponent('PlaybackRateMenuButton').prototype.controlText_ = 'Speed'
@@ -226,8 +227,10 @@ export class PeertubePlayerManager {
226 } 227 }
227 228
228 if (mode === 'p2p-media-loader') { 229 if (mode === 'p2p-media-loader') {
230 const redundancyUrlManager = new RedundancyUrlManager(options.p2pMediaLoader.redundancyBaseUrls)
231
229 const p2pMediaLoader: P2PMediaLoaderPluginOptions = { 232 const p2pMediaLoader: P2PMediaLoaderPluginOptions = {
230 redundancyBaseUrls: options.p2pMediaLoader.redundancyBaseUrls, 233 redundancyUrlManager,
231 type: 'application/x-mpegURL', 234 type: 'application/x-mpegURL',
232 startTime: commonOptions.startTime, 235 startTime: commonOptions.startTime,
233 src: p2pMediaLoaderOptions.playlistUrl 236 src: p2pMediaLoaderOptions.playlistUrl
@@ -242,7 +245,7 @@ export class PeertubePlayerManager {
242 segmentValidator: segmentValidatorFactory(options.p2pMediaLoader.segmentsSha256Url), 245 segmentValidator: segmentValidatorFactory(options.p2pMediaLoader.segmentsSha256Url),
243 rtcConfig: getRtcConfig(), 246 rtcConfig: getRtcConfig(),
244 requiredSegmentsPriority: 5, 247 requiredSegmentsPriority: 5,
245 segmentUrlBuilder: segmentUrlBuilderFactory(options.p2pMediaLoader.redundancyBaseUrls) 248 segmentUrlBuilder: segmentUrlBuilderFactory(redundancyUrlManager)
246 }, 249 },
247 segments: { 250 segments: {
248 swarmId: p2pMediaLoaderOptions.playlistUrl 251 swarmId: p2pMediaLoaderOptions.playlistUrl