-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vimeo duration not available until starting playback #250
Comments
This is my workaround for the moment: if ( isVimeoUrl( videoUrl ) ) {
this.player.getInternalPlayer().getDuration().then(
duration => this.setState({ duration })
)
} |
@rijk, hey! At current time ReactPlayer suggests that duration will be requested only after playing. That behavior of ReactPlayer inherited from some external players (I mean Streamable, but may be not only it). But it's possible to get duration earlier for Vimeo: this.player.on('loaded', () => {
this.player.getDuration().then(duration => {
this.duration = duration
})
this.onReady()
}) ...(it's possible to get duration even earlier)... |
Vimeo duration is fetched on load as of version |
That is awesome @cookpete ! |
To reproduce:
Expected behaviour:
duration | 1:00
Actual behaviour:
duration | 0:00
This is a problem especially when trying to implement https://alexanderwallin.github.io/react-player-controls/#ProgressBar. Because there is no known
totalTime
, the bar produces an error upon seeking (Seconds must be a positive number less than the duration of the video
).The text was updated successfully, but these errors were encountered: