From 6385fe58036fc45c94d04a0279a64e275816e5bf Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 3 Mar 2022 14:30:55 +0100 Subject: Fix stuck hls player with bad redundancy --- client/package.json | 4 ++-- .../src/assets/player/peertube-player-options-builder.ts | 6 +++++- client/yarn.lock | 16 ++++++++-------- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/client/package.json b/client/package.json index 721f6ea84..26ca15210 100644 --- a/client/package.json +++ b/client/package.json @@ -53,8 +53,8 @@ "@ngx-loading-bar/core": "^6.0.0", "@ngx-loading-bar/http-client": "^6.0.0", "@ngx-loading-bar/router": "^6.0.0", - "@peertube/p2p-media-loader-core": "^1.0.5", - "@peertube/p2p-media-loader-hlsjs": "^1.0.7", + "@peertube/p2p-media-loader-core": "^1.0.6", + "@peertube/p2p-media-loader-hlsjs": "^1.0.8", "@peertube/videojs-contextmenu": "^5.5.0", "@peertube/xliffmerge": "^2.0.3", "@types/chart.js": "^2.9.16", diff --git a/client/src/assets/player/peertube-player-options-builder.ts b/client/src/assets/player/peertube-player-options-builder.ts index 71be5ccff..7a82b128d 100644 --- a/client/src/assets/player/peertube-player-options-builder.ts +++ b/client/src/assets/player/peertube-player-options-builder.ts @@ -268,10 +268,14 @@ export class PeertubePlayerOptionsBuilder { return { trackerAnnounce, - segmentValidator: segmentValidatorFactory(this.options.p2pMediaLoader.segmentsSha256Url, this.options.common.isLive), rtcConfig: getRtcConfig(), + simultaneousHttpDownloads: 1, + httpFailedSegmentTimeout: 1000, + + segmentValidator: segmentValidatorFactory(this.options.p2pMediaLoader.segmentsSha256Url, this.options.common.isLive), segmentUrlBuilder: segmentUrlBuilderFactory(redundancyUrlManager, 1), + useP2P: this.options.common.p2pEnabled, consumeOnly, diff --git a/client/yarn.lock b/client/yarn.lock index 2c2123c36..847fe77d2 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -1564,10 +1564,10 @@ tslib "^2.3.0" yargs-parser "20.0.0" -"@peertube/p2p-media-loader-core@^1.0.5": - version "1.0.5" - resolved "https://registry.yarnpkg.com/@peertube/p2p-media-loader-core/-/p2p-media-loader-core-1.0.5.tgz#a9332cd35854be8641b04dd99a1fb444528ddaa8" - integrity sha512-AeZELrwP0LW+VO65MKFYwsObNr3uavoYp4pTnutX/Csv+S5ICT13o99lndfq5p1IKkS7UmDt5ffY9VFlr0GZrQ== +"@peertube/p2p-media-loader-core@^1.0.6": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@peertube/p2p-media-loader-core/-/p2p-media-loader-core-1.0.6.tgz#e5d1b02aa60fe3a8b82dd486745d9ac8cdddbac0" + integrity sha512-S3xdYU5MPIf8LtXpd2EXtJJLIPtjQxRYbS3ytnx5t83/ALnP+p8OVR5u+sq3ghq5EMsxbCXUn29pR88BHSdyQw== dependencies: bittorrent-tracker "^9.16.1" debug "^4.3.1" @@ -1575,10 +1575,10 @@ sha.js "^2.4.11" simple-peer "^9.10.0" -"@peertube/p2p-media-loader-hlsjs@^1.0.7": - version "1.0.7" - resolved "https://registry.yarnpkg.com/@peertube/p2p-media-loader-hlsjs/-/p2p-media-loader-hlsjs-1.0.7.tgz#2246f9ad8c541efa031056fbc9e1ffe38bf391b5" - integrity sha512-fK5YchZUK1zjoCak+1KYLWt9fGBeIkUOx/joVw+suHoe8y16X6QTpYoB8FGaz+lNm8G6FOcDgcX7CEYu0I4azA== +"@peertube/p2p-media-loader-hlsjs@^1.0.8": + version "1.0.8" + resolved "https://registry.yarnpkg.com/@peertube/p2p-media-loader-hlsjs/-/p2p-media-loader-hlsjs-1.0.8.tgz#fb638709fe7155aecd978f4a58c03f660c3649f8" + integrity sha512-x+NNNdwiE87chZRv3RbDfWNvhAca1MkhmbF7vYwnQnBPZndpv6053dSnTUmckihRSAfW0wNi1evbFQ80ip57dw== dependencies: events "^3.3.0" m3u8-parser "^4.6.0" -- cgit v1.2.3