fire-app-builder icon indicating copy to clipboard operation
fire-app-builder copied to clipboard

Listen to exo player events from app

Open billymcintosh opened this issue 8 years ago • 3 comments

I'm trying to hook into the player events for analytical purposes. I'm seeing debug information such as: -

D/PlaybackActivity: State change event! Oldstate= PLAYING NewState= READY and I/ExoPlayerStateMachineImpl: getDuration()= 61529

I'm wishing to listen to this if possible.

Could someone point me in the right direction?

billymcintosh avatar Feb 13 '17 15:02 billymcintosh

Hi billy. What do you mean by listen to this?

brcox avatar Feb 13 '17 19:02 brcox

Hi @brcox, I'm really just looking for wherever the PlaybackActivity is broadcasting the change events - oldstate and newstate. Or if I can hook in and listen for these events then act upon them.

billymcintosh avatar Feb 13 '17 20:02 billymcintosh

Please look at the PlaybackActivity class's onPlayerStateChange method. There's also an AnalyticsHelper class that listens for playback state change.

brian-ross avatar Jun 18 '18 21:06 brian-ross