Improve playback with bad redundancies
This commit is contained in:
parent
f0ab2aed3d
commit
0067a77d23
|
@ -55,8 +55,8 @@
|
||||||
"@ngx-loading-bar/core": "^5.0.0",
|
"@ngx-loading-bar/core": "^5.0.0",
|
||||||
"@ngx-loading-bar/http-client": "^5.0.0",
|
"@ngx-loading-bar/http-client": "^5.0.0",
|
||||||
"@ngx-loading-bar/router": "^5.0.0",
|
"@ngx-loading-bar/router": "^5.0.0",
|
||||||
"@peertube/p2p-media-loader-core": "^1.0.2",
|
"@peertube/p2p-media-loader-core": "^1.0.4",
|
||||||
"@peertube/p2p-media-loader-hlsjs": "^1.0.4",
|
"@peertube/p2p-media-loader-hlsjs": "^1.0.6",
|
||||||
"@types/chart.js": "^2.9.16",
|
"@types/chart.js": "^2.9.16",
|
||||||
"@types/core-js": "^2.5.2",
|
"@types/core-js": "^2.5.2",
|
||||||
"@types/debug": "^4.1.5",
|
"@types/debug": "^4.1.5",
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
import { Segment } from '@peertube/p2p-media-loader-core'
|
import { Segment } from '@peertube/p2p-media-loader-core'
|
||||||
import { RedundancyUrlManager } from './redundancy-url-manager'
|
import { RedundancyUrlManager } from './redundancy-url-manager'
|
||||||
|
|
||||||
function segmentUrlBuilderFactory (redundancyUrlManager: RedundancyUrlManager) {
|
function segmentUrlBuilderFactory (redundancyUrlManager: RedundancyUrlManager, requiredSegmentsPriority: number) {
|
||||||
return function segmentBuilder (segment: Segment) {
|
return function segmentBuilder (segment: Segment) {
|
||||||
|
// Don't use redundancy for high priority segments
|
||||||
|
if (segment.priority <= requiredSegmentsPriority) return segment.url
|
||||||
|
|
||||||
return redundancyUrlManager.buildUrl(segment.url)
|
return redundancyUrlManager.buildUrl(segment.url)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -374,7 +374,7 @@ export class PeertubePlayerManager {
|
||||||
rtcConfig: getRtcConfig(),
|
rtcConfig: getRtcConfig(),
|
||||||
requiredSegmentsPriority: 1,
|
requiredSegmentsPriority: 1,
|
||||||
simultaneousHttpDownloads: 1,
|
simultaneousHttpDownloads: 1,
|
||||||
segmentUrlBuilder: segmentUrlBuilderFactory(redundancyUrlManager),
|
segmentUrlBuilder: segmentUrlBuilderFactory(redundancyUrlManager, 1),
|
||||||
useP2P: getStoredP2PEnabled(),
|
useP2P: getStoredP2PEnabled(),
|
||||||
consumeOnly
|
consumeOnly
|
||||||
},
|
},
|
||||||
|
|
|
@ -1701,10 +1701,10 @@
|
||||||
tslib "^2.0.0"
|
tslib "^2.0.0"
|
||||||
yargs-parser "20.0.0"
|
yargs-parser "20.0.0"
|
||||||
|
|
||||||
"@peertube/p2p-media-loader-core@^1.0.2":
|
"@peertube/p2p-media-loader-core@^1.0.4":
|
||||||
version "1.0.2"
|
version "1.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/@peertube/p2p-media-loader-core/-/p2p-media-loader-core-1.0.2.tgz#ef36a23df5a5393cc5d180a45dfb70d2c3ecff87"
|
resolved "https://registry.yarnpkg.com/@peertube/p2p-media-loader-core/-/p2p-media-loader-core-1.0.4.tgz#61ef559e57b582c334790f0dc0230ee038703614"
|
||||||
integrity sha512-2F6Cx2ncXe+ySaaGiAWf7jJ8snJpyd7WNCxYbJ5Zadst1mNSQlxUqH4/qEl/bai4DiuzzhudlzXS8U3SX9c9Jw==
|
integrity sha512-JuWMTMTkyQRUf3VbGElQ6VlbKCiFUu5ioMEPNwYx75rE+BPnIXQf6jMUyAEpPoHhGSlcef546Z3mxcDHKJtZ6g==
|
||||||
dependencies:
|
dependencies:
|
||||||
bittorrent-tracker "^9.16.1"
|
bittorrent-tracker "^9.16.1"
|
||||||
debug "^4.3.1"
|
debug "^4.3.1"
|
||||||
|
@ -1712,12 +1712,11 @@
|
||||||
sha.js "^2.4.11"
|
sha.js "^2.4.11"
|
||||||
simple-peer "^9.10.0"
|
simple-peer "^9.10.0"
|
||||||
|
|
||||||
"@peertube/p2p-media-loader-hlsjs@^1.0.4":
|
"@peertube/p2p-media-loader-hlsjs@^1.0.6":
|
||||||
version "1.0.4"
|
version "1.0.6"
|
||||||
resolved "https://registry.yarnpkg.com/@peertube/p2p-media-loader-hlsjs/-/p2p-media-loader-hlsjs-1.0.4.tgz#849809067886e41bf2ba7e71a2da33478863bc66"
|
resolved "https://registry.yarnpkg.com/@peertube/p2p-media-loader-hlsjs/-/p2p-media-loader-hlsjs-1.0.6.tgz#d7f6ee786d756e20953428322bdffec80691b78e"
|
||||||
integrity sha512-FFFlYPFwTGxB3CPChqlzPqJw65ajIjCCxCn4IQRNuagYpo0fdaxrgepMHNPW3Zl5DmvEppv+ohUfYyr98U1wiw==
|
integrity sha512-nCV+mgpLL+XVJg5zv5m0oiVxsS/V/+NfJ0HtmVEXSU0EP5S32zPGMQpSWRNwGT6o+VZnyvKOtiqZDIK1vpabyA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@peertube/p2p-media-loader-core" "^1.0.2"
|
|
||||||
events "^3.3.0"
|
events "^3.3.0"
|
||||||
m3u8-parser "^4.6.0"
|
m3u8-parser "^4.6.0"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue