STPlayerObserver

Use this protocol to observe the following events in the shared instance of STPlayer: change of state, end of a track and failure in playing a track. Each observer has to be added to the STPlayerObserverto be called.

Usage Example:

class MyClass: STPlayerObserver { /../ } let myObject = MyClass() STPlayer.shared?.add(observer: myObject)