react-player not working with react server side rendering
See original GitHub issueHi, trying to render server side a simple component that uses react-player and it doesn’t seem to be working.
Route handler looks like this:
const ServerPost = (props) => (
<ReactPlayer url='https://www.youtube.com/watch?v=ysz5S6PUM-U' playing />
);
var html = ReactDOMServer.renderToString(
React.createElement(ServerPost, post),
);
reply(html);
DOM element looks like this:
<div style="width:640px;height:360px;" data-reactroot="" data-reactid="1" data-react-checksum="-1272364945">
<div style="height:100%;display:block;" data-reactid="2">
<div id="youtube-player-0" data-reactid="3"></div>
</div>
</div>
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:5 (3 by maintainers)
Top Results From Across the Web
react-player not working with react server side rendering #113
Hi, trying to render server side a simple component that uses react-player and it doesn't seem to be working. Route handler looks like...
Read more >Is react-html5video is compatible with server side rendering ...
It seems the package is indeed not compatible with SSR. You could try to lazy-load your Player component on the client side with ......
Read more >ReactPlayer - Best of JS
A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia, Mixcloud, DailyMotion ...
Read more >react-player | Yarn - Package Manager
A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and DailyMotion.
Read more >react-player - npm
A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and ...
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
Hi @CookPete , shouldn’t the iframe be added to the generated html then ?
Hey @cookpete I know this is a reeeeeeally old issue however I do think that a lack of basic SSR is a problem. For sites which use the video thumbnail for their LCP then CSR of the
background-image
is going to result in massive performance problem. Would you be willing to accept a PR which adds SSR support for the preview\thumbnail markup?