React Player rendering empty div
See original GitHub issueCurrent Behavior
My video component looks like this:
// https://github.com/cookpete/react-player/issues/1428
import dynamic from 'next/dynamic'
const ReactPlayer = dynamic(() => import('react-player/lazy'), { ssr: false })
export default function Video({src}) {
return <ReactPlayer src={src} />
}
I use it like this:
<Video src="https://www.youtube.com/watch?v=grHP-de1p-U" />
Instead of seeing the video rendered on my page, I’m getting a blank div, in my dev tools I see:
<div src="https://www.youtube.com/watch?v=grHP-de1p-U" style="width: 640px; height: 360px;"></div>
Expected Behavior
See the video rendered on my page.
Environment
- URL attempting to play: https://www.youtube.com/watch?v=grHP-de1p-U
- Browser: Any.
- Operating system: OSX
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top Results From Across the Web
javascript - React rendering empty - Stack Overflow
i am new to react. I read documentation and tried to research my problem. i am curious why my page keeps rendering empty...
Read more >Preserving and Resetting State - React Docs
The counter state gets reset when you click the checkbox. Although you render a Counter , the first child of the div changes...
Read more >React.createElement() > React with Symfony - SymfonyCasts
The existing app is rendered in this js-rep-log-table element. Above this, add a new <div class="row"> and inside, an empty div we can...
Read more >Building a Video Player with React and Material UI
React player is a component used in rendering various video ... Navigate to your App.css file and style the Player Div using the...
Read more >empty - CSS: Cascading Style Sheets - MDN Web Docs
1. div:empty { ; 2. outline: 2px solid deeppink; ; 3. height: 1em; ; 4. } ; 5. ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I always used
url
property. In my case the problem was React Strict Mode https://reactjs.org/docs/strict-mode.html.Similar problem with 2.11.0 version 2.10.1 is working