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

Event at playback time? #1472

Closed
damienoliver opened this issue Apr 26, 2016 · 6 comments
Closed

Event at playback time? #1472

damienoliver opened this issue Apr 26, 2016 · 6 comments
Labels

Comments

@damienoliver
Copy link

damienoliver commented Apr 26, 2016

Hi,
I would like to dispatch event's at defined times during playback. Does exoplayer have a time observer object suitable for this use? ...I would like to avoid polling the currentPosition value if possible.

Thanks!

@ojw28
Copy link
Contributor

ojw28 commented Apr 26, 2016

No, there's no built in support for that. Although you could easily implement your own TrackRenderer and inject it into the player that could dispatch events at specified times during playback.

@ojw28 ojw28 closed this as completed Apr 26, 2016
@ojw28 ojw28 added the question label Apr 26, 2016
@damienoliver
Copy link
Author

Thanks for the tip. doSomeWork(long positionUs, long elapsedRealtimeUs) seems to fire quick enough for my needs. Cheers.

@rakesh1988
Copy link

is there an equivalent in exoplayer2?

@andrewlewis
Copy link
Collaborator

The equivalent would be implementing your own Renderer (subclassing BaseRenderer) and using positionUs passed to render.

@ojw28
Copy link
Contributor

ojw28 commented Jun 12, 2017

Providing a more convenient API for this is also tracked by #2189.

@google google locked and limited conversation to collaborators Jun 28, 2017
@tonihei
Copy link
Collaborator

tonihei commented Nov 28, 2017

We're currently working on this feature to let the player run a callback when it reaches a certain playback position. We would like to have your opinion on some edge cases in #2189 - please let us know what would fit your requirements best.

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

No branches or pull requests

5 participants