aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-14 16:20:36 +0200
committerChocobozzz <me@florianbigard.com>2021-10-14 17:06:41 +0200
commit0067a77d23c8d4afa2649b62b5251665e35b8b3d (patch)
tree1f7b6565e5b932b013814c68976d75093ed20277
parentf0ab2aed3d98240c53e952ada2d2a1d18a5ba23f (diff)
downloadPeerTube-0067a77d23c8d4afa2649b62b5251665e35b8b3d.tar.gz
PeerTube-0067a77d23c8d4afa2649b62b5251665e35b8b3d.tar.zst
PeerTube-0067a77d23c8d4afa2649b62b5251665e35b8b3d.zip
Improve playback with bad redundancies
-rw-r--r--client/package.json4
-rw-r--r--client/src/assets/player/p2p-media-loader/segment-url-builder.ts5
-rw-r--r--client/src/assets/player/peertube-player-manager.ts2
-rw-r--r--client/yarn.lock17
4 files changed, 15 insertions, 13 deletions
diff --git a/client/package.json b/client/package.json
index ac85366c3..ede26a3f7 100644
--- a/client/package.json
+++ b/client/package.json
@@ -55,8 +55,8 @@
55 "@ngx-loading-bar/core": "^5.0.0", 55 "@ngx-loading-bar/core": "^5.0.0",
56 "@ngx-loading-bar/http-client": "^5.0.0", 56 "@ngx-loading-bar/http-client": "^5.0.0",
57 "@ngx-loading-bar/router": "^5.0.0", 57 "@ngx-loading-bar/router": "^5.0.0",
58 "@peertube/p2p-media-loader-core": "^1.0.2", 58 "@peertube/p2p-media-loader-core": "^1.0.4",
59 "@peertube/p2p-media-loader-hlsjs": "^1.0.4", 59 "@peertube/p2p-media-loader-hlsjs": "^1.0.6",
60 "@types/chart.js": "^2.9.16", 60 "@types/chart.js": "^2.9.16",
61 "@types/core-js": "^2.5.2", 61 "@types/core-js": "^2.5.2",
62 "@types/debug": "^4.1.5", 62 "@types/debug": "^4.1.5",
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 @@
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) { 4function 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}
diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts
index 230d6298b..73b5bc01c 100644
--- a/client/src/assets/player/peertube-player-manager.ts
+++ b/client/src/assets/player/peertube-player-manager.ts
@@ -374,7 +374,7 @@ export class PeertubePlayerManager {
374 rtcConfig: getRtcConfig(), 374 rtcConfig: getRtcConfig(),
375 requiredSegmentsPriority: 1, 375 requiredSegmentsPriority: 1,
376 simultaneousHttpDownloads: 1, 376 simultaneousHttpDownloads: 1,
377 segmentUrlBuilder: segmentUrlBuilderFactory(redundancyUrlManager), 377 segmentUrlBuilder: segmentUrlBuilderFactory(redundancyUrlManager, 1),
378 useP2P: getStoredP2PEnabled(), 378 useP2P: getStoredP2PEnabled(),
379 consumeOnly 379 consumeOnly
380 }, 380 },
diff --git a/client/yarn.lock b/client/yarn.lock
index 44ec1bfe6..20941258e 100644
--- a/client/yarn.lock
+++ b/client/yarn.lock
@@ -1701,10 +1701,10 @@
1701 tslib "^2.0.0" 1701 tslib "^2.0.0"
1702 yargs-parser "20.0.0" 1702 yargs-parser "20.0.0"
1703 1703
1704"@peertube/p2p-media-loader-core@^1.0.2": 1704"@peertube/p2p-media-loader-core@^1.0.4":
1705 version "1.0.2" 1705 version "1.0.4"
1706 resolved "https://registry.yarnpkg.com/@peertube/p2p-media-loader-core/-/p2p-media-loader-core-1.0.2.tgz#ef36a23df5a5393cc5d180a45dfb70d2c3ecff87" 1706 resolved "https://registry.yarnpkg.com/@peertube/p2p-media-loader-core/-/p2p-media-loader-core-1.0.4.tgz#61ef559e57b582c334790f0dc0230ee038703614"
1707 integrity sha512-2F6Cx2ncXe+ySaaGiAWf7jJ8snJpyd7WNCxYbJ5Zadst1mNSQlxUqH4/qEl/bai4DiuzzhudlzXS8U3SX9c9Jw== 1707 integrity sha512-JuWMTMTkyQRUf3VbGElQ6VlbKCiFUu5ioMEPNwYx75rE+BPnIXQf6jMUyAEpPoHhGSlcef546Z3mxcDHKJtZ6g==
1708 dependencies: 1708 dependencies:
1709 bittorrent-tracker "^9.16.1" 1709 bittorrent-tracker "^9.16.1"
1710 debug "^4.3.1" 1710 debug "^4.3.1"
@@ -1712,12 +1712,11 @@
1712 sha.js "^2.4.11" 1712 sha.js "^2.4.11"
1713 simple-peer "^9.10.0" 1713 simple-peer "^9.10.0"
1714 1714
1715"@peertube/p2p-media-loader-hlsjs@^1.0.4": 1715"@peertube/p2p-media-loader-hlsjs@^1.0.6":
1716 version "1.0.4" 1716 version "1.0.6"
1717 resolved "https://registry.yarnpkg.com/@peertube/p2p-media-loader-hlsjs/-/p2p-media-loader-hlsjs-1.0.4.tgz#849809067886e41bf2ba7e71a2da33478863bc66" 1717 resolved "https://registry.yarnpkg.com/@peertube/p2p-media-loader-hlsjs/-/p2p-media-loader-hlsjs-1.0.6.tgz#d7f6ee786d756e20953428322bdffec80691b78e"
1718 integrity sha512-FFFlYPFwTGxB3CPChqlzPqJw65ajIjCCxCn4IQRNuagYpo0fdaxrgepMHNPW3Zl5DmvEppv+ohUfYyr98U1wiw== 1718 integrity sha512-nCV+mgpLL+XVJg5zv5m0oiVxsS/V/+NfJ0HtmVEXSU0EP5S32zPGMQpSWRNwGT6o+VZnyvKOtiqZDIK1vpabyA==
1719 dependencies: 1719 dependencies:
1720 "@peertube/p2p-media-loader-core" "^1.0.2"
1721 events "^3.3.0" 1720 events "^3.3.0"
1722 m3u8-parser "^4.6.0" 1721 m3u8-parser "^4.6.0"
1723 1722