Open bnbs opened 3 months ago
yes, the types could use some refinements.
if we look at the native video element currentTime should start at 0
, as does getSecondsLoaded()
so those should be fine.
however duration
is NaN by default which doesn't have an equivalent in TS so undefined or unknown would make sense here
I'm implementing a custom player in TypeScript and for this I have a class that extends
BaseReactPlayer<ReactPlayerProps>
. I initializeduration
,currentTime
andsecondsLoaded
tonull
, but I noticed that thegetDuration
,getCurrentTime
andgetSecondsLoaded
methods must return a number, so TypeScript complains about this since I'm initializing these values as null. I took a look at all the players that exist in react-player and noticed that if not all, then almost all players return null in these methods and not just numbers, so I assumed that the types are not correct. Am I missing something or are the types just not correct?