-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Handling component unmounting before player is ready #531
Comments
Was this resolved? |
I'm not sure why this would ever happen. There is a specific check when stopping/unmounting to ensure the player is attached to the DOM, and the If anyone can reliably cause this error, please post an example repo or jsFiddle. |
I ended up just grabbing a reference to the YouTube instance and destroying it in We were able to repro fairly consistently between two routes with @hassaans I'd recommend manually destroying the instance to see if that helps. |
@cookpete If you quickly move away from the page before the video loads, this error is thrown:
This doesn't affect user experience, but it's really cluttering our Sentry. I suggest reopening this issue. |
|
I'm sure this is very annoying, but I have already described the how the library already is trying to avoid this error. If it is still happening, I cannot fix it unless I can consistently reproduce it. If anyone can give instructions on how to reliably cause this error, I will take a look when I get some time.
I have attempted this but I cannot get the error to occur. The steps to reproduce are not specific enough. |
I have found another issue raise on a similar library that may help reproduce: |
We are facing this issue too actually, and when I remove this code block, and add only
the issue is gone. So I am wondering why are you checking the isReady state on componentWillUnmount ? and what if just delete this part ? |
Within my single page app a user can navigate between views that may or may not contain videos. When loading a view with a video (with react-player) and switching to a non-video view before the player has finished loading we see this error:
We do have a callback registered to
onProgress={onVideoProgress}
This clearly comes from the Youtube API, but I'm wondering if there is a hook from react-player that I can use to destroy the player on componentWillUnmount to avoid this console error?
Similar issues like (#20) didn't seem to apply in this case.
The text was updated successfully, but these errors were encountered: