-
-
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
Getting warning 'video is being deferred until the player has loaded' #413
Comments
I'm passing in youtube video that I'm getting from prop. How do I pass the url after onReady event? |
You should be just passing the |
@cookpete That worked! I was passing the url on every render, fixed it by adding a conditional statement. |
@djohal How to pass the URLs on every render? I also getting URLs from prop. THX |
@djohal could you please describe, where did you add conditional statement to resolve the issue? Thanks in advance! |
@cookpete can you please help me out with same issue 'warning - video is being deferred until the player has loaded', i didn't get the solution clearly. |
The solution is to not change the |
@cookpete what would be the preferred approach in case you do want to dynamically change the url on, for example, a click event elsewhere in the application? |
There are many answers for this (and it's not really relevant to the issue) but the most basic way would be to have something like const [url, setUrl] = useState(null) in a top-level component somewhere. Then pass <ReactPlayer={url} ... /> and then pass <button onClick={() => setUrl('https://whatever')}>Click me!</button> You could also use context, or redux, or any state management library. |
The reason I asked this question right here is because I, like you said, changed the However, when I run tests (with the React Testing Library), I get this warning in the console. |
Ah yeah, changing I'm considering getting rid of that guard altogether, or at least a prop that avoids it. It seems to cause more problems than it solves. |
Also having the same problem as @MitchelSt |
Also having the same problem as @MitchelSt as well. |
I'm getting this warning every time player is trying to load my video. It works fine when it loads the video for the first time, but after that for all other videos it shows a glimpse of previous video and then loads the actual one.
How can I wait for the player to fully load before sending in the url?
This is my what my code looks like:
I'm probably doing something wrong here. It'd be great if you can help me out with this issue!
p.s. thanks for your amazing work!
The text was updated successfully, but these errors were encountered: