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

When minified, only one player component is mounted #17

Closed
Fauntleroy opened this issue Dec 27, 2015 · 4 comments
Closed

When minified, only one player component is mounted #17

Fauntleroy opened this issue Dec 27, 2015 · 4 comments

Comments

@Fauntleroy
Copy link
Contributor

I'm having a bit of an odd issue here:

When I use react-player in my project, then minify the project bundle, only one of the players will mount (the YouTube player). I have a hunch that displayName is somehow involved (since all react-player components are shown as t in the React DevTools).

screen shot 2015-12-27 at 9 05 25 am

#### Steps to replicate - Create a project that uses browserify - Use `react-player` in that project - Browserify your code - Minify your code - When the player is mounted, you should only see one player type mounted inside of it #### Ideas - Try minifying `react-player` in the test page and see if we can replicate the issue there - Try manually setting `displayName` for every component
@Fauntleroy
Copy link
Contributor Author

It looks like if you add a displayName to every component, the problem is resolved:

screen shot 2015-12-27 at 9 20 37 am

@cookpete
Copy link
Owner

Thanks for this @Fauntleroy! I'll add a quick commit and publish a patched version now.

@Fauntleroy
Copy link
Contributor Author

bro_arms

@cookpete
Copy link
Owner

Fixed in v0.3.1

Thumbs up

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