From a77c5ff3622ab75d0c22241d0ef72053deaa7926 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 21 Jul 2022 12:08:47 +0200 Subject: Fix stucked HLS player --- .../src/assets/player/shared/manager-options/hls-options-builder.ts | 4 +++- .../src/assets/player/shared/p2p-media-loader/segment-url-builder.ts | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'client/src/assets') diff --git a/client/src/assets/player/shared/manager-options/hls-options-builder.ts b/client/src/assets/player/shared/manager-options/hls-options-builder.ts index ed12f6e8b..a572febc2 100644 --- a/client/src/assets/player/shared/manager-options/hls-options-builder.ts +++ b/client/src/assets/player/shared/manager-options/hls-options-builder.ts @@ -82,7 +82,7 @@ export class HLSOptionsBuilder { httpFailedSegmentTimeout: 1000, segmentValidator: segmentValidatorFactory(this.options.p2pMediaLoader.segmentsSha256Url, this.options.common.isLive), - segmentUrlBuilder: segmentUrlBuilderFactory(redundancyUrlManager, 1), + segmentUrlBuilder: segmentUrlBuilderFactory(redundancyUrlManager), useP2P: this.options.common.p2pEnabled, consumeOnly, @@ -123,6 +123,7 @@ export class HLSOptionsBuilder { private getP2PMediaLoaderVODOptions (): Partial { return { requiredSegmentsPriority: 3, + skipSegmentBuilderPriority: 1, cachedSegmentExpiration: 86400000, cachedSegmentsCount: 100, @@ -158,6 +159,7 @@ export class HLSOptionsBuilder { ...base, abrEwmaDefaultEstimate: averageBandwidth * 8, // We want bit/s + backBufferLength: 90, startLevel: -1, testBandwidth: false, debug: false diff --git a/client/src/assets/player/shared/p2p-media-loader/segment-url-builder.ts b/client/src/assets/player/shared/p2p-media-loader/segment-url-builder.ts index 9d324078a..ad0e460ae 100644 --- a/client/src/assets/player/shared/p2p-media-loader/segment-url-builder.ts +++ b/client/src/assets/player/shared/p2p-media-loader/segment-url-builder.ts @@ -1,11 +1,8 @@ import { Segment } from '@peertube/p2p-media-loader-core' import { RedundancyUrlManager } from './redundancy-url-manager' -function segmentUrlBuilderFactory (redundancyUrlManager: RedundancyUrlManager, useOriginPriority: number) { +function segmentUrlBuilderFactory (redundancyUrlManager: RedundancyUrlManager) { return function segmentBuilder (segment: Segment) { - // Don't use redundancy for high priority segments - if (segment.priority <= useOriginPriority) return segment.url - return redundancyUrlManager.buildUrl(segment.url) } } -- cgit v1.2.3