I have an application which’s using React Player to play mp4 files which are located in Firebase.
For some odd reason, the video’s length in Firefox is calculated straight as page loads:
This issue causes my in Chrome to to users not being able to change to the time in the video they wish to play, until the video is almost fully loaded, then it shows the video’s total duration and then the user is also able change via the seek bar. It also pops the following error:
When I try to print playerRef.current.getDuration(), I get value of Infinity.
I have tried adding custom headers to the firebase’s put function:
const headers = {
"Content-Length": estimatedVideoLength.toString(),
"Content-Type": file.type,
};
without a success.
I have no idea what else could I do.
Any ideas? :_)