Runtime error when using multiple plyr instances where one was destroyed
See original GitHub issueRun https://jsfiddle.net/jason_sanjose/s0c1g4vz/ and follow instructions in comments.
Summary:
-
Multiple plyr instances in use
-
Call
destroy()
on any one instance -
Toggle fullscreen on a remaining plyr instance
-
Observe runtime error due to orphaned event handler from destroyed instance (see below)
-
Issue does not already exist
-
Issue observed on https://plyr.io
Expected behaviour
No error
Actual behaviour
plyr.js:1 Uncaught TypeError: Cannot read property 'querySelectorAll' of null
at B (plyr.js:1)
at J (plyr.js:1)
at HTMLDocument.he (plyr.js:1)
Environment
- Browser: Chrome
- Version: 63
- Operating System: Windows
- Version: 10
Players affected:
- HTML5 Video
- HTML5 Audio
- YouTube
- Vimeo
Steps to reproduce
Run https://jsfiddle.net/jason_sanjose/s0c1g4vz/ and follow instructions in comments
Relevant links
Need a matching _off
for https://github.com/sampotts/plyr/blob/master/src/js/plyr.js#L3198 when destroying a plyr instance
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:13 (8 by maintainers)
Top Results From Across the Web
Fix Runtime Error With 12 Workable Ways
Runtime errors can hamper your productivity. Here's a guide on these errors and how to stop them from popping up.
Read more >Attempt to access BP, but BP is pending kill - World Creation
Attempting to access data from a variable that is set to be “destroyed” will result in a “pending kill” error while trying to...
Read more >How to Fix Hulu Error Code Runtime 2 - Lifewire
In most cases, this issue can be corrected by updating your Hulu app and streaming device, clearing the local cache, and resetting your...
Read more >Instantiation - Photon Engine
When a client leaves a room, the remaining players will destroy the GameObjects created by the leaving player. If this doesn't fit your...
Read more >Update NavMesh at Runtime - Unity Forum
How do you update a nav mesh at runtime with the new API? I haven't been able to find any decent examples or...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This should be fixed in
3.0.0-beta.18
- I can now calldestroy()
and get no errors. Sorry about that…Closing this one as I think it’s fixed but feel free to re-open if not solved in v3 👍