Skip to content
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

Get the time remaining on a video/audio #28

Closed
Conrad777 opened this issue Jan 14, 2016 · 4 comments
Closed

Get the time remaining on a video/audio #28

Conrad777 opened this issue Jan 14, 2016 · 4 comments

Comments

@Conrad777
Copy link

Hi @cookpete maybe I'm just missing it, but I can't find a way to check how much time is still left on a song or the total length of the clip? Is that because there is no way to do it yet or did I just over look it?

@cookpete
Copy link
Owner

Hey @Conrad777, there actually isn't a way to get it from the player yet, but this is a good idea. Perhaps it should be part of the onProgress callback? A direct method like getDuration could be too problematic if it was called before the player had any duration information.

Maybe this even warrants a new callback prop, onDuration or something

@Conrad777
Copy link
Author

I agree with making it a callback... You're only ever going to need it after the clip has loaded anyway. onDuration sound cleaner to me than making it part of onProgress don't you think?

I am basically just agreeing with you, not even sure if its helping.

@cookpete
Copy link
Owner

Yeah, at first I was reluctant to add yet another onSomething prop, but it doesn't really belong in onProgress.

I am basically just agreeing with you, not even sure if its helping.

Any feedback is a great help :)

@cookpete
Copy link
Owner

Fixed in v0.5.0, thanks @Conrad777!

david-hub024 pushed a commit to david-hub024/React_VideoPlayer that referenced this issue Dec 23, 2018
Adds a getDuration method to each player, and sends the result of that through onDuration when a player becomes ready
Fixes cookpete/react-player#28
david-hub024 pushed a commit to david-hub024/React_VideoPlayer that referenced this issue May 23, 2020
Adds a getDuration method to each player, and sends the result of that through onDuration when a player becomes ready
Fixes cookpete/react-player#28
albanqoku added a commit to albanqoku/react-player that referenced this issue Feb 24, 2021
Adds a getDuration method to each player, and sends the result of that through onDuration when a player becomes ready
Fixes cookpete/react-player#28
Webmaster1116 added a commit to Webmaster1116/video-player that referenced this issue May 20, 2021
Adds a getDuration method to each player, and sends the result of that through onDuration when a player becomes ready
Fixes cookpete/react-player#28
webmiraclepro added a commit to webmiraclepro/video-player that referenced this issue Sep 9, 2022
Adds a getDuration method to each player, and sends the result of that through onDuration when a player becomes ready
Fixes cookpete/react-player#28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants