
Kotlin 2020 solution approach UPDATE
Events such as changes in state and playback errors are reported to registered Player.EventListener
instances.
Player.EventListener
has empty default methods, so you only need to implement the methods you’re interested in.
First your class, say your activity, has te conform to the Player.EventListener
interface.