Exemple #1
0
 /// <summary>
 /// Properly cleanup of your player by releasing resources
 /// </summary>
 public override void OnDestroy()
 {
     base.OnDestroy();
     if (musicPlayer != null)
     {
         musicPlayer.MediaPlayer.Release();
         musicPlayer = null;
     }
 }
Exemple #2
0
 /// <summary>
 /// On create simply detect some of our managers
 /// </summary>
 public override void OnCreate()
 {
     base.OnCreate();
     //intent = new Intent(Globals.TestAction);
     networkController = new NetworkController();
     musicPlayer       = new MusicPlayerController();
     playList          = new Playlist();
     FullPlaylist      = new Playlist();
     SetupPlaylist();
 }
Exemple #3
0
        /// <summary>
        /// Initialize
        /// </summary>
        private void Initialize()
        {
            dataController = new DataController();
            //Playlist = new Playlist();
            networkController = new NetworkController();
            musicPlayer       = new MusicPlayerController();

            //Make the music player play the next song automatically
            musicPlayer.MediaPlayer.Completion += (sender, args) => Next();
            //When we have error in the media player
            musicPlayer.MediaPlayer.Error += (sender, args) =>
            {
                //StartForeground("Error in media player", "");
                // t.Text = "Error in media player";
                Stop();
            };
        }