http-streaming icon indicating copy to clipboard operation
http-streaming copied to clipboard

Tech events not unregistered when experimentalBufferBasedABR is set to true

Open tiagobnobrega opened this issue 3 years ago • 1 comments

Description

When switching from live content to VOD content while experimentalBufferBasedABR is set to true, causes previous ABR timers to keep running after the MasterPlaylistController is disposed. I believe this is due to the fact that events added to tech (https://github.com/videojs/http-streaming/blob/main/src/master-playlist-controller.js#L294-L295) are not being unregistered on the dispose function (https://github.com/videojs/http-streaming/blob/main/src/master-playlist-controller.js#L1646)

reduced test case

Sources

No specific source. the reduced test case has public sources

Steps to reproduce

Explain in detail the exact steps necessary to reproduce the issue.

  1. Load the test case
  2. Place a breakpoint at _proto.checkABR_
  3. Click "Switch to Live"
  4. Click "Switch to VOD"
  5. _proto.checkABR_ will be called with the first playlistLoader and the with the second playlistLoader

CleanShot 2022-03-21 at 16 55 55

Results

Expected

CheckABR_ function should be called only with the latest PlaylistLoader context

Error output

No errors happen on the console.

Additional Information

This led to more problems in a complex scenario, where requests were being dispatched from the previous PlaylistLoader ad aeternum. Another thing pointing toward the problem with the unregistration of the events on tech is that pausing the videos causes the request to stop. Playing the video again resumes the requests.

videojs-http-streaming version

what version of videojs-http-streaming does this occur with? from /[email protected]

videojs version

what version of videojs does this occur with? [email protected]

Browsers

what browsers are affected? please include browser and version for each *Chrome,Fiirefox

Platforms

what platforms are affected? please include operating system and version or device and version for each *Mac OS, Windows

Other Plugins

are any other videojs plugins being used on the page? If so, please list them with version below. *Not in the reduced test case

Other JavaScript

are you using any other javascript libraries or frameworks on the page? if so please list them below. *Not in the reduced test case

tiagobnobrega avatar Mar 21 '22 20:03 tiagobnobrega

👋 Thanks for opening your first issue here! 👋

If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines.

welcome[bot] avatar Mar 21 '22 20:03 welcome[bot]