question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Runtime error when using multiple plyr instances where one was destroyed

See original GitHub issue

Run 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
sampottscommented, Mar 13, 2018

This should be fixed in 3.0.0-beta.18 - I can now call destroy() and get no errors. Sorry about that…

1reaction
sampottscommented, Mar 21, 2018

Closing this one as I think it’s fixed but feel free to re-open if not solved in v3 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found