sphinx-kotlin
sphinx-kotlin copied to clipboard
Audio Message Focus Listener
Playing an audio message gains focus, but upon pausing and/or completion, is not abandoning that focus and then re-requesting focus again. This is attributed to the use of ApplicationContext, whereby the current listener cannot be re-registered after abandoning.
Reproduce:
- While listening to podcast or some other audio external to the chat, play an audio message
- let audio message complete
- Play previous podcast or some other audio external to the chat.
- Play the audio message
- Audio message plays over top the podcast
Refactor AudioPlayerControllerImpl by moving listener interface to an internal class such that a new request can be completed with a new listener when audio focus is requested.