public void registerPlayerListener ( CheerleaderPlayerListener listener ) { checkState ( ) ; mCheerleaderPlayerListeners . add ( listener ) ; if ( mState == STATE_PLAYING ) { listener . onPlayerPlay ( mPlayerPlaylist . getCurrentTrack ( ) , mPlayerPlaylist . getCurrentTrackIndex ( ) ) ; } else if ( mState == STATE_PAUSED ) { listener . onPlayerPause ( ) ; } }
Register a listener to catch player events .