diff options
author | Chocobozzz <me@florianbigard.com> | 2022-07-21 12:08:47 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-07-21 12:08:47 +0200 |
commit | a77c5ff3622ab75d0c22241d0ef72053deaa7926 (patch) | |
tree | a59ae4057eb9d9e45d42d839f4f3d77686d956a3 | |
parent | a6c554fb6eeda7500215cca0d10930b0db4ddb0a (diff) | |
download | PeerTube-a77c5ff3622ab75d0c22241d0ef72053deaa7926.tar.gz PeerTube-a77c5ff3622ab75d0c22241d0ef72053deaa7926.tar.zst PeerTube-a77c5ff3622ab75d0c22241d0ef72053deaa7926.zip |
Fix stucked HLS player
-rw-r--r-- | client/package.json | 6 | ||||
-rw-r--r-- | client/src/assets/player/shared/manager-options/hls-options-builder.ts | 4 | ||||
-rw-r--r-- | client/src/assets/player/shared/p2p-media-loader/segment-url-builder.ts | 5 | ||||
-rw-r--r-- | client/webpack/webpack.video-embed.js | 2 | ||||
-rw-r--r-- | client/yarn.lock | 25 |
5 files changed, 22 insertions, 20 deletions
diff --git a/client/package.json b/client/package.json index 862e7dbef..0b7c041ed 100644 --- a/client/package.json +++ b/client/package.json | |||
@@ -52,8 +52,8 @@ | |||
52 | "@ngx-loading-bar/core": "^6.0.0", | 52 | "@ngx-loading-bar/core": "^6.0.0", |
53 | "@ngx-loading-bar/http-client": "^6.0.0", | 53 | "@ngx-loading-bar/http-client": "^6.0.0", |
54 | "@ngx-loading-bar/router": "^6.0.0", | 54 | "@ngx-loading-bar/router": "^6.0.0", |
55 | "@peertube/p2p-media-loader-core": "^1.0.7", | 55 | "@peertube/p2p-media-loader-core": "^1.0.13", |
56 | "@peertube/p2p-media-loader-hlsjs": "^1.0.11", | 56 | "@peertube/p2p-media-loader-hlsjs": "^1.0.13", |
57 | "@peertube/videojs-contextmenu": "^5.5.0", | 57 | "@peertube/videojs-contextmenu": "^5.5.0", |
58 | "@peertube/xliffmerge": "^2.0.3", | 58 | "@peertube/xliffmerge": "^2.0.3", |
59 | "@popperjs/core": "^2.11.5", | 59 | "@popperjs/core": "^2.11.5", |
@@ -96,7 +96,7 @@ | |||
96 | "expect-webdriverio": "^3.4.0", | 96 | "expect-webdriverio": "^3.4.0", |
97 | "focus-visible": "^5.0.2", | 97 | "focus-visible": "^5.0.2", |
98 | "geckodriver": "^3.0.1", | 98 | "geckodriver": "^3.0.1", |
99 | "hls.js": "^1.0.7", | 99 | "hls.js": "1.2.0-beta.2", |
100 | "html-loader": "^3.0.1", | 100 | "html-loader": "^3.0.1", |
101 | "html-webpack-plugin": "^5.3.1", | 101 | "html-webpack-plugin": "^5.3.1", |
102 | "https-browserify": "^1.0.0", | 102 | "https-browserify": "^1.0.0", |
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 @@ | |||
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, useOriginPriority: number) { | 4 | function 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 | } |
diff --git a/client/webpack/webpack.video-embed.js b/client/webpack/webpack.video-embed.js index 547e8aa63..3f2805192 100644 --- a/client/webpack/webpack.video-embed.js +++ b/client/webpack/webpack.video-embed.js | |||
@@ -24,6 +24,8 @@ module.exports = function () { | |||
24 | 24 | ||
25 | modules: [ helpers.root('src'), 'node_modules' ], | 25 | modules: [ helpers.root('src'), 'node_modules' ], |
26 | 26 | ||
27 | symlinks: true, | ||
28 | |||
27 | alias: { | 29 | alias: { |
28 | 'video.js$': path.resolve('node_modules/video.js/core.js'), | 30 | 'video.js$': path.resolve('node_modules/video.js/core.js'), |
29 | 'hls.js$': path.resolve('node_modules/hls.js/dist/hls.light.js'), | 31 | 'hls.js$': path.resolve('node_modules/hls.js/dist/hls.light.js'), |
diff --git a/client/yarn.lock b/client/yarn.lock index 81eae1cea..573497376 100644 --- a/client/yarn.lock +++ b/client/yarn.lock | |||
@@ -1823,10 +1823,10 @@ | |||
1823 | node-addon-api "^3.2.1" | 1823 | node-addon-api "^3.2.1" |
1824 | node-gyp-build "^4.3.0" | 1824 | node-gyp-build "^4.3.0" |
1825 | 1825 | ||
1826 | "@peertube/p2p-media-loader-core@^1.0.7": | 1826 | "@peertube/p2p-media-loader-core@^1.0.13", "@peertube/p2p-media-loader-core@^1.0.8": |
1827 | version "1.0.7" | 1827 | version "1.0.13" |
1828 | resolved "https://registry.yarnpkg.com/@peertube/p2p-media-loader-core/-/p2p-media-loader-core-1.0.7.tgz#605a6bd248dc95cf8e73a65e37183dcb9f4a795a" | 1828 | resolved "https://registry.yarnpkg.com/@peertube/p2p-media-loader-core/-/p2p-media-loader-core-1.0.13.tgz#36744a291b69c001b2562c1a93017979f8534ff8" |
1829 | integrity sha512-J5VQBaS/L6b0yVNIBLnES4WcsHp4Z6IrAuYNIgG3iC5UcejeA1YHftZ/dAOlzZXQx77qYM7OJtmYAUsQ+2Pd4g== | 1829 | integrity sha512-ArSAaeuxwwBAG0Xd3Gj0TzKObLfJFYzHz9+fREvmUf+GZQEG6qGwWmrdVWL6xjPiEuo6LdFeCOnHSQzAbj/ptg== |
1830 | dependencies: | 1830 | dependencies: |
1831 | bittorrent-tracker "^9.19.0" | 1831 | bittorrent-tracker "^9.19.0" |
1832 | debug "^4.3.4" | 1832 | debug "^4.3.4" |
@@ -1834,11 +1834,12 @@ | |||
1834 | sha.js "^2.4.11" | 1834 | sha.js "^2.4.11" |
1835 | simple-peer "^9.11.1" | 1835 | simple-peer "^9.11.1" |
1836 | 1836 | ||
1837 | "@peertube/p2p-media-loader-hlsjs@^1.0.11": | 1837 | "@peertube/p2p-media-loader-hlsjs@^1.0.13": |
1838 | version "1.0.11" | 1838 | version "1.0.13" |
1839 | resolved "https://registry.yarnpkg.com/@peertube/p2p-media-loader-hlsjs/-/p2p-media-loader-hlsjs-1.0.11.tgz#1dba2e020ea7df766c5e951839811f21ffeda542" | 1839 | resolved "https://registry.yarnpkg.com/@peertube/p2p-media-loader-hlsjs/-/p2p-media-loader-hlsjs-1.0.13.tgz#5305e2008041d01850802544d1c49298f79dd67a" |
1840 | integrity sha512-6BbcTRK/Dfaxq7XvWZU0sgLKiyVdaW9CWKMpNxnYjN3YGkKrXgJpY7rEnyydzaCxdVMQ5/qXKil/nOdf1aZ3BA== | 1840 | integrity sha512-2BO2oaRsSHEhLkgi2iw1r4n1Yqq1EnyoOgOZccPDqjmHUsZSV/wNrno8WYr6LsleudrHA26Imu57hVD1jDx7lg== |
1841 | dependencies: | 1841 | dependencies: |
1842 | "@peertube/p2p-media-loader-core" "^1.0.8" | ||
1842 | debug "^4.3.4" | 1843 | debug "^4.3.4" |
1843 | events "^3.3.0" | 1844 | events "^3.3.0" |
1844 | m3u8-parser "^4.7.1" | 1845 | m3u8-parser "^4.7.1" |
@@ -6211,10 +6212,10 @@ he@1.2.0, he@^1.2.0: | |||
6211 | resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" | 6212 | resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" |
6212 | integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== | 6213 | integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== |
6213 | 6214 | ||
6214 | hls.js@^1.0.7: | 6215 | hls.js@1.2.0-beta.2: |
6215 | version "1.1.5" | 6216 | version "1.2.0-beta.2" |
6216 | resolved "https://registry.yarnpkg.com/hls.js/-/hls.js-1.1.5.tgz#923a8a8cfdf09542578696d47c8ae435da981ffd" | 6217 | resolved "https://registry.yarnpkg.com/hls.js/-/hls.js-1.2.0-beta.2.tgz#4a23f854c3bd69e86353e5570433637297372b4b" |
6217 | integrity sha512-mQX5TSNtJEzGo5HPpvcQgCu+BWoKDQM6YYtg/KbgWkmVAcqOCvSTi0SuqG2ZJLXxIzdnFcKU2z7Mrw/YQWhPOA== | 6218 | integrity sha512-2+eruNX25TfoO0RRtqdQrlbwbqpKSnJZdXvVHDDGaVfDRmAAcJ3pSIQrRCxIJCiXxu0wECO8qmcj6Qjcw7eOCQ== |
6218 | 6219 | ||
6219 | hosted-git-info@^2.1.4: | 6220 | hosted-git-info@^2.1.4: |
6220 | version "2.8.9" | 6221 | version "2.8.9" |