ReactPlayer.js
cannot play the video streamed from an API.
<video controls src='http://localhost:3001/api/video/my_video' /> // it works
<ReactPlayer url="http://localhost:3001/api/video/my_video" controls/> // failed to work
What is displayed using a <video>
HTML element:
What is displayed when I use ReactPlayer
:
This might work if you're facing CORS cross-origin restriction issue
<ReactPlayer
url="http://localhost:3001/api/video/my_video"
config={{
file: {
attributes: {
crossOrigin: "true",
}
}
}}
controls
/>;