diff options
Diffstat (limited to 'client/src/assets')
-rw-r--r-- | client/src/assets/player/p2p-media-loader/segment-url-builder.ts | 5 | ||||
-rw-r--r-- | client/src/assets/player/peertube-player-manager.ts | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/client/src/assets/player/p2p-media-loader/segment-url-builder.ts b/client/src/assets/player/p2p-media-loader/segment-url-builder.ts index ad0e460ae..5ddc81ff6 100644 --- a/client/src/assets/player/p2p-media-loader/segment-url-builder.ts +++ b/client/src/assets/player/p2p-media-loader/segment-url-builder.ts | |||
@@ -1,8 +1,11 @@ | |||
1 | import { Segment } from '@peertube/p2p-media-loader-core' | 1 | import { Segment } from '@peertube/p2p-media-loader-core' |
2 | import { RedundancyUrlManager } from './redundancy-url-manager' | 2 | import { RedundancyUrlManager } from './redundancy-url-manager' |
3 | 3 | ||
4 | function segmentUrlBuilderFactory (redundancyUrlManager: RedundancyUrlManager) { | 4 | function segmentUrlBuilderFactory (redundancyUrlManager: RedundancyUrlManager, requiredSegmentsPriority: number) { |
5 | return function segmentBuilder (segment: Segment) { | 5 | return function segmentBuilder (segment: Segment) { |
6 | // Don't use redundancy for high priority segments | ||
7 | if (segment.priority <= requiredSegmentsPriority) return segment.url | ||
8 | |||
6 | return redundancyUrlManager.buildUrl(segment.url) | 9 | return redundancyUrlManager.buildUrl(segment.url) |
7 | } | 10 | } |
8 | } | 11 | } |
diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts index 230d6298b..73b5bc01c 100644 --- a/client/src/assets/player/peertube-player-manager.ts +++ b/client/src/assets/player/peertube-player-manager.ts | |||
@@ -374,7 +374,7 @@ export class PeertubePlayerManager { | |||
374 | rtcConfig: getRtcConfig(), | 374 | rtcConfig: getRtcConfig(), |
375 | requiredSegmentsPriority: 1, | 375 | requiredSegmentsPriority: 1, |
376 | simultaneousHttpDownloads: 1, | 376 | simultaneousHttpDownloads: 1, |
377 | segmentUrlBuilder: segmentUrlBuilderFactory(redundancyUrlManager), | 377 | segmentUrlBuilder: segmentUrlBuilderFactory(redundancyUrlManager, 1), |
378 | useP2P: getStoredP2PEnabled(), | 378 | useP2P: getStoredP2PEnabled(), |
379 | consumeOnly | 379 | consumeOnly |
380 | }, | 380 | }, |