diff options
author | Chocobozzz <me@florianbigard.com> | 2021-10-14 16:20:36 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-10-14 17:06:41 +0200 |
commit | 0067a77d23c8d4afa2649b62b5251665e35b8b3d (patch) | |
tree | 1f7b6565e5b932b013814c68976d75093ed20277 /client/src/assets/player/p2p-media-loader | |
parent | f0ab2aed3d98240c53e952ada2d2a1d18a5ba23f (diff) | |
download | PeerTube-0067a77d23c8d4afa2649b62b5251665e35b8b3d.tar.gz PeerTube-0067a77d23c8d4afa2649b62b5251665e35b8b3d.tar.zst PeerTube-0067a77d23c8d4afa2649b62b5251665e35b8b3d.zip |
Improve playback with bad redundancies
Diffstat (limited to 'client/src/assets/player/p2p-media-loader')
-rw-r--r-- | client/src/assets/player/p2p-media-loader/segment-url-builder.ts | 5 |
1 files changed, 4 insertions, 1 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 | } |