From 0067a77d23c8d4afa2649b62b5251665e35b8b3d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 14 Oct 2021 16:20:36 +0200 Subject: Improve playback with bad redundancies --- client/src/assets/player/p2p-media-loader/segment-url-builder.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'client/src/assets/player/p2p-media-loader') 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 @@ import { Segment } from '@peertube/p2p-media-loader-core' import { RedundancyUrlManager } from './redundancy-url-manager' -function segmentUrlBuilderFactory (redundancyUrlManager: RedundancyUrlManager) { +function segmentUrlBuilderFactory (redundancyUrlManager: RedundancyUrlManager, requiredSegmentsPriority: number) { return function segmentBuilder (segment: Segment) { + // Don't use redundancy for high priority segments + if (segment.priority <= requiredSegmentsPriority) return segment.url + return redundancyUrlManager.buildUrl(segment.url) } } -- cgit v1.2.3