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

With Next.js using React 18, I cannot play the video from the onReady. #1429

Closed
es-ki opened this issue Apr 2, 2022 · 5 comments
Closed

Comments

@es-ki
Copy link

es-ki commented Apr 2, 2022

Current Behavior

When I try to play a video in onReady, the video does not play.
In addition, the following message is displayed on the console.

react_devtools_backend.js:3973 ReactPlayer: YouTube player could not call getCurrentTime – The method was not available

Expected Behavior

Play the video as soon as it is ready to be played.

Steps to Reproduce

  1. Clone this repository.
  2. yarn
  3. yarn dev
  4. Enter the YouTube video URL in the text form.

Environment

Other Information

It worked if I did not use Next.js.
CodeSandBox

@joaoD3V
Copy link

joaoD3V commented Apr 9, 2022

It's same here. Yesterday, I upgrade Next 11 to Next 12 and React 17 to React 18. In old version of these two libraries don't occur loop of warnings. I guess is related to issue #377

@cookpete
Copy link
Owner

cookpete commented May 2, 2022

Should be fixed in react@18.1.0 and react-dom@18.1.0

@cookpete cookpete closed this as completed May 2, 2022
@es-ki
Copy link
Author

es-ki commented May 5, 2022

@cookpete
Thanks for confirming this issue.

I tried it on react@18.1.0 and react-dom@18.1.0 but did not see any improvement.
The repository is as follows.
https://github.com/Sakaki-Ya/test.git
package.json

ezgif-4-402c509817

@bciach
Copy link

bciach commented Nov 29, 2023

Any update on this issue? it doesnt work in next 13/14 and react18 @cookpete

@es-ki @joaoD3V have you managed to solve this issue?

@joaoD3V
Copy link

joaoD3V commented Nov 30, 2023

In Next 13, I implemented React Player in Player.tsx component and used dynamic import to import this component inside 'use client' component. It's working fine for me @bciach

image

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

4 participants