/* * Server has been told that we completed playback of the current song */ private void OnPlayCompleted(Session s, JSONNode play) { if ((activePlayState != null) && (activePlayState.id == (string) play["id"])) { activePlayState = null; // force us into play mode in case we were paused and hit // skip to complete the current song paused = false; } }
private void OnPlayActive(Session s, JSONNode play) { activePlayState = new ActivePlayState { id = play["id"], playStarted = false, startReportedToServer = false, soundCompleted = false, previousPosition = 0 }; StartCoroutine(PlaySound(play["id"], play["audio_file"]["url"], play["audio_file"]["duration_in_seconds"].AsFloat)); }