Closed ankithkonda closed 5 years ago
@ankithkonda Do you have an example file where this happens? I can't find one anywhere to debug the problem.
@grydstedt I'm getting a 403
error for that URL :(
I also have the same problem with webm videos (generated with the MediaDevices.getUserMedia lib). indeed, when I start playing the video, the onProgress function does not fire at each progressInterval @CookPete @grydstedt, have you found a solution to this problem? thanks
onProgress
requires a duration
in order to return the percentages for played
and loaded
:
My guess is that these files are not returning a valid duration
for some reason.
@CookPete sorry this completely fell off my radar. Do you have an example file where this happens? I can't find one anywhere to debug the problem.
happy to send through an example in a few days
@ankithkonda I still can't reproduce this myself, but a falsey duration
is the only reasonable explanation for onProgress
not firing correctly for certain files.
@CookPete
In the case when duration
is equal to Infinity
(this is the case for streams), this check:
https://github.com/CookPete/react-player/blob/37700cc6a8c7a1d6c2d1796862ff4aafb45739f9/src/Player.js#L113
will always be if (0 !== 0 || 0 !== 0)
since there will be 0 when dividing any number by infinity. I suggest checking here playedSeconds
and loadedSeconds
instead of played
and loaded
.
Hi @CookPete! I was wondering if you have a fix for this, I've noticed you closed the issue
Hi @KasFijolek, this should hopefully be fixed in v1.11.1
after I took @janakhad's suggestion and updated the logic to compare playedSeconds
and loadedSeconds
instead of played
and loaded
fractions, which would always be zero for streams with Infinity
duration.
awesome, thanks for the swift response! 🙂
I'm getting the same problem with webp files. I printed the value of onDuration and still getting Infinity value. The weird thing is, when you do it manually on browser console you get the correct values
Hi onProgress is only called once when a webm file is being played. onProgress works as expected with mp3 files
The webm file i'm using is audio only.