p2p media loader flow
2023-02-28 09:36:48 0 举报
p2p media loader
作者其他创作
大纲/内容
if (updateSegmentsMap && !this.settings.consumeOnly)
N
Y
this.getStreamSwarmId(requestUrl)
End
Hls.loadSource(this.videoUrl);
this.settings.httpDownloadInitialTimeout > 0 &&this.settings.httpDownloadInitialTimeoutPerSegment > 0
this.segmentRequest = new SegmentRequest(...)
if (segmentsMap.get(segment.id) !== media_peer_1.MediaPeerSegmentStatus.Loaded) {
if (storageSegments.has(segment.id) || this.httpManager.isDownloading(segment))
set downloadRandomSegmentOverHttp by interval httpDownloadProbabilityInterval
this.p2pManager.download(segment)
Not enough P2P download resources. Abort one of the P2P downloads
this.processSegmentsQueue(storageSegments)
if (this.p2pManager.getActiveDownloadsCount() >= this.settings.simultaneousP2PDownloads)
callbacksuccessPlaylist
if (segment.priority <= this.settings.requiredSegmentsPriority)
segmentManager.loadPlaylist(context.url)
if (segment.priority <= this.settings.requiredSegmentsPriority && httpAllowed && !this.httpManager.isFailed(segment)) {
stop all http requests and p2p downloads for segments that are not in the new load
if (this.p2pManager.isDownloading(segment))
masterPlaylist url: https://cph-p2p-msl.akamaized.net/hls/live/2000341/test/master.m3u8playlist url: https://cph-p2p-msl.akamaized.net/hls/live/2000341/test/level_0.m3u8masterSwarmId: span style=\
this.playQueue.push(...)
font color=\"#000000\
is playlist?
this.p2pManager.download(segment)
HlsJsLoader.load()
this.cleanSegmentsStorage()
this.p2pManager.sendSegmentsMapToAll(this.createSegmentsMap(storageSegments))
this.p2pManager.getActiveDownloadsCount() < this.settings.simultaneousP2PDownloads && segment.priority <= this.settings.p2pDownloadMaxPriority
if (this.p2pManager.getActiveDownloadsCount() < this.settings.simultaneousP2PDownloads)
this.trackerClient.start();
this.trackerClient.on(\"error\
this.getMasterSwarmId()
Start
setprocessInitialSegmentTimeout()
for (let index = 0; index < this.segmentsQueue.length; index++) {
get the segments to download based on forwardSegmentCount and liveSyncDurationCountfor (let i = segmentIndex; i < playlistSegments.length && segments.length < this.settings.forwardSegmentCount; ++i)
this.segmentManager.loadSegment()
this.masterPlaylist = playlist
Not enough HTTP download resources. Abort one of the HTTP downloads.
this.createClient(infoHash)
set masterSwarmId
if (this.httpManager.getActiveDownloadsCount() >= this.settings.simultaneousHttpDownloads) {
is frag?
if (this.httpManager.getActiveDownloadsCount() < this.settings.simultaneousHttpDownloads) {
isMasterPlaylist
Hls
收藏
0 条评论
下一页