-
Notifications
You must be signed in to change notification settings - Fork 138
Open
Description
Hi there,
I noticed that manifest.addEventListener('manifestUpdate', () => {}) been added for many times without clear previous listeners. Which will eventually lead to unexpected resource (CPU/Memory) usage.
Code block as below:
rx-player/src/core/stream/adaptation/adaptation_stream.ts
Lines 519 to 548 in 00f9b0c
| manifest.addEventListener( | |
| "manifestUpdate", | |
| (updates) => { | |
| for (const element of updates.updatedPeriods) { | |
| if (element.period.id === period.id) { | |
| for (const updated of element.result.updatedAdaptations) { | |
| if (updated.adaptation === adaptation.id) { | |
| for (const rep of updated.removedRepresentations) { | |
| if (rep === representation.id) { | |
| if (fnCancelSignal.isCancelled()) { | |
| return; | |
| } | |
| return callbacks.waitingMediaSourceReload({ | |
| bufferType: adaptation.type, | |
| period, | |
| timeOffset: 0, | |
| stayInPeriod: true, | |
| }); | |
| } | |
| } | |
| } | |
| } | |
| } else if (element.period.start > period.start) { | |
| break; | |
| } | |
| } | |
| }, | |
| fnCancelSignal, | |
| ); | |
| } |
Reproduce steps
- Make sure you're using single mode
- Play any live events
- Check
rxPlayerInstance._priv_contentInfos.manifest._listeners.manifestUpdatebeen increased timely

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels