diff options
author | Chocobozzz <me@florianbigard.com> | 2019-08-23 10:19:44 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-08-23 10:28:21 +0200 |
commit | da3324177025b15ca23d84dd4249e3c7ba95053c (patch) | |
tree | d83265f1e24e27eb6162f09299ec54728cd3d139 /client/src/assets/player/peertube-player-manager.ts | |
parent | 20ec03846ddb40d8aeaa87fc92b8bd7994c3ecf7 (diff) | |
download | PeerTube-da3324177025b15ca23d84dd4249e3c7ba95053c.tar.gz PeerTube-da3324177025b15ca23d84dd4249e3c7ba95053c.tar.zst PeerTube-da3324177025b15ca23d84dd4249e3c7ba95053c.zip |
Improve HLS redundancy
Diffstat (limited to 'client/src/assets/player/peertube-player-manager.ts')
-rw-r--r-- | client/src/assets/player/peertube-player-manager.ts | 7 |
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 ' | |||
17 | import { getCompleteLocale, getShortLocale, is18nLocale, isDefaultLocale } from '../../../../shared/models/i18n/i18n' | 17 | import { getCompleteLocale, getShortLocale, is18nLocale, isDefaultLocale } from '../../../../shared/models/i18n/i18n' |
18 | import { segmentValidatorFactory } from './p2p-media-loader/segment-validator' | 18 | import { segmentValidatorFactory } from './p2p-media-loader/segment-validator' |
19 | import { segmentUrlBuilderFactory } from './p2p-media-loader/segment-url-builder' | 19 | import { segmentUrlBuilderFactory } from './p2p-media-loader/segment-url-builder' |
20 | import { 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) |
22 | videojsUntyped.getComponent('PlaybackRateMenuButton').prototype.controlText_ = 'Speed' | 23 | videojsUntyped.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 |