aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-07-21 12:08:47 +0200
committerChocobozzz <me@florianbigard.com>2022-07-21 12:08:47 +0200
commita77c5ff3622ab75d0c22241d0ef72053deaa7926 (patch)
treea59ae4057eb9d9e45d42d839f4f3d77686d956a3 /client/src/assets/player
parenta6c554fb6eeda7500215cca0d10930b0db4ddb0a (diff)
downloadPeerTube-a77c5ff3622ab75d0c22241d0ef72053deaa7926.tar.gz
PeerTube-a77c5ff3622ab75d0c22241d0ef72053deaa7926.tar.zst
PeerTube-a77c5ff3622ab75d0c22241d0ef72053deaa7926.zip
Fix stucked HLS player
Diffstat (limited to 'client/src/assets/player')
-rw-r--r--client/src/assets/player/shared/manager-options/hls-options-builder.ts4
-rw-r--r--client/src/assets/player/shared/p2p-media-loader/segment-url-builder.ts5
2 files changed, 4 insertions, 5 deletions
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 {
82 httpFailedSegmentTimeout: 1000, 82 httpFailedSegmentTimeout: 1000,
83 83
84 segmentValidator: segmentValidatorFactory(this.options.p2pMediaLoader.segmentsSha256Url, this.options.common.isLive), 84 segmentValidator: segmentValidatorFactory(this.options.p2pMediaLoader.segmentsSha256Url, this.options.common.isLive),
85 segmentUrlBuilder: segmentUrlBuilderFactory(redundancyUrlManager, 1), 85 segmentUrlBuilder: segmentUrlBuilderFactory(redundancyUrlManager),
86 86
87 useP2P: this.options.common.p2pEnabled, 87 useP2P: this.options.common.p2pEnabled,
88 consumeOnly, 88 consumeOnly,
@@ -123,6 +123,7 @@ export class HLSOptionsBuilder {
123 private getP2PMediaLoaderVODOptions (): Partial<HybridLoaderSettings> { 123 private getP2PMediaLoaderVODOptions (): Partial<HybridLoaderSettings> {
124 return { 124 return {
125 requiredSegmentsPriority: 3, 125 requiredSegmentsPriority: 3,
126 skipSegmentBuilderPriority: 1,
126 127
127 cachedSegmentExpiration: 86400000, 128 cachedSegmentExpiration: 86400000,
128 cachedSegmentsCount: 100, 129 cachedSegmentsCount: 100,
@@ -158,6 +159,7 @@ export class HLSOptionsBuilder {
158 ...base, 159 ...base,
159 160
160 abrEwmaDefaultEstimate: averageBandwidth * 8, // We want bit/s 161 abrEwmaDefaultEstimate: averageBandwidth * 8, // We want bit/s
162 backBufferLength: 90,
161 startLevel: -1, 163 startLevel: -1,
162 testBandwidth: false, 164 testBandwidth: false,
163 debug: false 165 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 @@
1import { Segment } from '@peertube/p2p-media-loader-core' 1import { Segment } from '@peertube/p2p-media-loader-core'
2import { RedundancyUrlManager } from './redundancy-url-manager' 2import { RedundancyUrlManager } from './redundancy-url-manager'
3 3
4function segmentUrlBuilderFactory (redundancyUrlManager: RedundancyUrlManager, useOriginPriority: number) { 4function segmentUrlBuilderFactory (redundancyUrlManager: RedundancyUrlManager) {
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 <= useOriginPriority) return segment.url
8
9 return redundancyUrlManager.buildUrl(segment.url) 6 return redundancyUrlManager.buildUrl(segment.url)
10 } 7 }
11} 8}