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

Light Mode Shows No Preview Image #1142

Closed
onurtahmaz opened this issue Jan 19, 2021 · 5 comments
Closed

Light Mode Shows No Preview Image #1142

onurtahmaz opened this issue Jan 19, 2021 · 5 comments

Comments

@onurtahmaz
Copy link

react-player's light mode shows no preview image. There was no problem with preview images in light mode but somehow this started to happen.

Here is a screenshot of the issue: https://ibb.co/hdLdGmv

My version of react-player is 2.7.0.

Here is how I use it in my GatsbyJS website:
<ReactPlayer css={videoPlayer} url={url} ref={refMovie} width='50vw' light={1} controls={0} />

I also used light={true} which resulted in the same behavior.

I import it like this:
import ReactPlayer from 'react-player';

Any help would be much appreciated since it looks unprofessional using it like this. Plus, if I do not use the light mode, it increases the CPU usage in the web page causing laggy UX.

@cookpete
Copy link
Owner

This comment probably applies here: #1130 (comment)

Check the URL you are trying to use on https://noembed.com/demo

If you have a URL to an image, you can pass it in to the light prop. eg

<ReactPlayer url={url} light='https://example.com/thumbnail.jpg' />

@onurtahmaz
Copy link
Author

Yeap, I saw this.
The URLs work on noembed's demo.
I have almost 20 pages and in each page there are approximately 5 video links. If I pass a thumbnail link to each one of them, I might end up preparing 100 preview images.
Do you think there is another way that would make the use of light mode possible without losing that amount of time for each video link.

@cookpete
Copy link
Owner

The URLs work on noembed's demo.

Interesting. Is there a console error (or network error) when your app makes the request to noembed?

Do you think there is another way that would make the use of light mode possible without losing that amount of time for each video link.

If you're not able to pass image URLs to light and noembed isn't working for you, there isn't really any way to make use of light mode.

@onurtahmaz
Copy link
Author

Thanks for the reply!

Nope, there is no console error. The interesting part is it was working 3 or 4 weeks ago.

Last question: Do you think there is a way to reduce the CPU usage when I use react-player without the light mode?

Thanks again for your time!

@Knogobert
Copy link

Had the same issue. Turning off adblock might help someone else!

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

3 participants