fire-app-builder
fire-app-builder copied to clipboard
Listen to exo player events from app
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?
Hi billy. What do you mean by listen to this?
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.
Please look at the PlaybackActivity class's onPlayerStateChange method. There's also an AnalyticsHelper class that listens for playback state change.