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

Allow to get the current playback time programmatically #187

Closed
FilippoVigani opened this issue Aug 22, 2018 · 6 comments
Closed

Allow to get the current playback time programmatically #187

FilippoVigani opened this issue Aug 22, 2018 · 6 comments
Labels

Comments

@FilippoVigani
Copy link

It would be nice to be able to get the current playback time directly from the player, instead of needing to subscribe to playback time changes and updating a "support" variable every time.

This is useful for implementing methods like skip(seconds: Float) where you need the current time of the player and call seek to seek to the desired point.

This would basically mean bridging the player.getCurrentTime() function from the js implementation.

@PierfrancescoSoffritti
Copy link
Owner

Hi, you can use YouTubePlayerTracker for doing that. Let me know if it helps.

@FilippoVigani
Copy link
Author

YoutubePlayerTracker somewhat does what I asked, although I'd consider implementing it by default inside the player itself. Closing for now.

@PierfrancescoSoffritti
Copy link
Owner

I'd rather not add noise to the API of the player. If a getter is added for the current time it would end up being added for every other property of the player. YouTubePlayerTracker keeps things clean.

@foal
Copy link

foal commented Aug 11, 2019

YouTubePlayerTracker returns incorrect time in case of seek paused video.

@PierfrancescoSoffritti
Copy link
Owner

Hi, what do you mean? I think you should open a separate issue for this.

@foal
Copy link

foal commented Aug 12, 2019

Done. #411

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants