question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

src is not set when using file

See original GitHub issue

Current Behavior

When setting URL = a mp4 the video SRC is never set, thus the player never loads. Occasionally when hot reloading kicks in the player will work.

Expected Behavior

setting url="https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/360/Big_Buck_Bunny_360_10s_1MB.mp4" should work

also tried, url={[{src: 'https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/360/Big_Buck_Bunny_360_10s_1MB.mp4'}]}

Steps to Reproduce

  • create react app
  • import import ReactPlayer from ‘react-player/file’; OR import ReactPlayer from ‘react-player’;
  • add player <ReactPlayer url="https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/360/Big_Buck_Bunny_360_10s_1MB.mp4" controls /> Screen Shot 2022-09-20 at 3 16 27 PM

Other Information

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
furkan-catcommented, Oct 8, 2022

Downgrading react-player to v2.10.1 or removing <React.StrictMode> fixes the issue. I believe the problem is PR #1360.

Yep when i remove the strict mode, all works fine. Is there any solution for this issue?

6reactions
rklfcommented, Sep 23, 2022

I was facing also this issue (React 18.2.0 - react-player 2.11.0)

Comment (or removing) <React.StrictMode> tag is fixing that in development environment (NODE_ENV), it is working in production environment (when app is built) though since <React.StrictMode> is ignored in production

Read more comments on GitHub >

github_iconTop Results From Across the Web

'img-src' was not explicitly set, so 'default-src' is used as a ...
In the example below, I have added img-src 'self' data:; to the start of the meta tag in the index. html file. I...
Read more >
<img>: The Image Embed element - HTML - MDN Web Docs
The src attribute is required, and contains the path to the image you want to embed. The alt attribute holds a text description...
Read more >
How to Set Up a Content Security Policy (CSP) in 3 Steps
Follow our guide on how to set up a Content Security Policy (CSP) for your website. We'll include common directives for you to...
Read more >
How to create a solid and secure Content Security Policy
Step 1: Start with a basic CSP header · default-src : if resources are not defined in the other sections, use this policy...
Read more >
Configuring Content Security Policy - Jenkins
The Javadoc Plugin makes Javadoc available for browsing in Jenkins. The default rule set does not allow use of frames in pages served...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found