Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error unmounting component: "TypeError: Cannot read property 'disablePIP' of undefined" #849

Closed
iniq opened this issue Apr 8, 2020 · 1 comment

Comments

@iniq
Copy link

iniq commented Apr 8, 2020

Current Behavior

When the screen is quickly refreshed or redirected before the player is fully initialized, an exception is thrown with the message "TypeError: Cannot read property 'disablePIP' of undefined" and the player fails to unmount.

Expected Behavior

The player unmounts.

Steps to Reproduce

We have not been able to reliably trigger it every time, but it is reasonably consistent with these steps:

  1. Have a screen with one or more player components included start to render
  2. The user clicks a button to cause a redirect before the player is fully initialized

Environment

  • URL attempting to play: any
  • Browser: Google Chrome, Safari, Microsoft Edge (possibly others)
  • Operating system: Mac OS, Windows (possibly others)
  • jsFiddle example:

Other Information

We believe the issue is caused here:
https://github.com/CookPete/react-player/blob/a4e89c0f9e0ad10dac4e57ea2cae670a7ffd29d3/src/Player.js#L32

In our debugging we believe we found that if this line is called before this.player is created and initialized, the exception is thrown.

@cookpete
Copy link
Owner

Fixed in v2.0.1

albanqoku added a commit to albanqoku/react-player that referenced this issue Feb 24, 2021
Webmaster1116 added a commit to Webmaster1116/video-player that referenced this issue May 20, 2021
webmiraclepro added a commit to webmiraclepro/video-player that referenced this issue Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants