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

react-player attempts to call this.player.getDuration() before method is available #18

Closed
Fauntleroy opened this issue Dec 28, 2015 · 1 comment

Comments

@Fauntleroy
Copy link
Contributor

If you tell the YouTube player to seek before the SDK has finished loading, react-player will attempt to call getDuration() and throw. I haven't checked into this with the other players yet.

Should be a simple fix: add a flag for whether or not the SDK has loaded yet. If the flag is false, don't try to call any methods provided by that SDK. Might also want to wrap the SDK methods with something normalized that does that check before calling the real method.

(Sorry about making issues with recommendations but not pull reqs—it's a bit difficult to get the full flow going while on holiday)

@cookpete
Copy link
Owner

I'm surprised the function doesn't return here in that case. Maybe that check needs to be better than just whether this.player exists.

Sorry about making issues with recommendations but not pull reqs—it's a bit difficult to get the full flow going while on holiday

No problem. Stop developing on holiday! 🍻

david-hub024 pushed a commit to david-hub024/React_VideoPlayer that referenced this issue Dec 23, 2018
david-hub024 pushed a commit to david-hub024/React_VideoPlayer that referenced this issue May 23, 2020
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