Skip to content

BaseReactPlayer types are not correct #1739

Closed as not planned
Closed as not planned
@bnbs

Description

@bnbs

I'm implementing a custom player in TypeScript and for this I have a class that extends BaseReactPlayer<ReactPlayerProps>. I initialize duration, currentTime and secondsLoaded to null, but I noticed that the getDuration, getCurrentTime and getSecondsLoaded 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementIndicates new feature requests

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions