You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just learned that according to MDN, when adding an event listener under the capturing phase, removing that event listener must also be under the capturing phase, what this means is that the browser tracks event listeners under the capturing phase separately than listeners under the bubbling phase:
window.addEventListener('resize',myFunc,true)window.removeEventListener('resize',myFunc,true)// <- true has to be passed in as 3rd arg, otherwise it won't work
In the following code in the plugin, that is not being followed and unfortunately those event listeners are staying around after the player is disposed. This is causing issues in my team's code as the player tries to access elements that are no longer there (and in general is a memory leak)
Description
I just learned that according to MDN, when adding an event listener under the capturing phase, removing that event listener must also be under the capturing phase, what this means is that the browser tracks event listeners under the capturing phase separately than listeners under the bubbling phase:
In the following code in the plugin, that is not being followed and unfortunately those event listeners are staying around after the player is disposed. This is causing issues in my team's code as the player tries to access elements that are no longer there (and in general is a memory leak)
videojs-vr/src/plugin.js
Line 514 in faa7d9a
videojs-vr/src/plugin.js
Line 548 in faa7d9a
My current workaround is to just monkey-patch the
reset
method:Steps to reproduce
Explain in detail the exact steps necessary to reproduce the issue.
Results
Expected
No errors
Actual
A console error is logged as the old listener tries to access a video element that is no longer there
versions
videojs
what version of videojs does this occur with? v6.11.0
browsers
what browser are affected? all browsers
OSes
what platforms (operating systems and devices) are affected? all platforms
The text was updated successfully, but these errors were encountered: