video.js
video.js copied to clipboard
Multiple video players have the probability to throw html5#one exception when they are frequently generated and destroyed
Description
I encountered an exception event when using video.es.js
I excluded all registered events one by one in my code, the exceptions still exist It looks like the problem comes from video.es
There is a time handler When players dispose, not clear it, there is a certain chance to encounter inactivityTimeout is triggered.


the tech_ exists But, tech_.eventBusEl_ is null

Reduced test case
No response
Steps to reproduce
- Channel Page Menu+Current Channel video List page
- The list page can be used to drop down and load more video players. The previous video player will be destroyed after a certain number of simultaneous downloads. 3.When you switch the channel menu, all videos are destroyed and the video list of the new channel is loaded.
- Scroll down the page quickly and keep making it load more video player At the same time, you can quickly click on the left menu to switch to other video channel and repeat the previous operation. Observe the console.
There is a chance to see videojs throw an exception error "html5#one" or "t#one"
Errors
Uncaught Error: Invalid target for t#one; must be a DOM node or evented object.","stack":"Error: Invalid target for t#one; must be a DOM node or evented object., Stack: Error: Invalid target for t#one; must be a DOM node or evented object.
What version of Video.js are you using?
7.20.3
Video.js plugins used.
No response
What browser(s) including version(s) does this occur with?
edge 111.0.1661.54 & chrome 111.0.5563.147
What OS(es) and version(s) does this occur with?
windows 11
👋 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.
That shouldn't be possible, as intervals are cleared on dispose. How are you disposing the players? What page do the steps to reproduce refer to?
I wasn't able to make this happen. Do yo uhave a test case?
@v-JialiChen I had the same issue. Here's how I fixed it:
if (this.player && !this.player.isDisposed()) {
this.player.dispose();
}
@mister-ben I'm not a contributor to this repo at all. But maybe a thought is that internally video.js should maybe ignore calls to dispose if it's already disposed. One could argue that this situation represents a user error since a user shouldn't try to dispose when video.js is already disposed. Though it'd make it more user-friendly to have this fix/improvement. Thanks for all the work you do on this project; we benefit from it muchly.