Example #1
0
 private void Enfileira(string videoPath)
 {
     if (videoPath != null)
     {
         Console.WriteLine(videoPath);
         fila.Enfileira(videoPath);
         if (fila.GetVideos.Count == 1)
         {
             if (mediaPlayer.playState != WMPPlayState.wmppsPlaying && mediaPlayer.playState != WMPPlayState.wmppsTransitioning)
             {
                 lock (fila)
                 {
                     string _fila = fila.Desenfileira();
                     Console.WriteLine("entrou: " + _fila);
                     if (!String.IsNullOrEmpty(_fila))
                     {
                         Console.WriteLine("entrou2: " + _fila);
                         try
                         {
                             //mediaPlayer.URL = @"C:\Users\alann\Videos\" + _fila;
                             WMPLib.IWMPMedia media = mediaPlayer.newMedia(@"C:\Users\alann\Videos\" + _fila);
                             mediaPlayer.currentPlaylist.appendItem(media);
                             mediaPlayer.Ctlcontrols.play(); // activates the play button
                             //mediaPlayer.Ctlcontrols.play();
                             //mediaPlayer.URL = fullPathOfYourFirstMedia;
                             //mediaPlayer.Ctlcontrols.play(); // activates the play button
                             //mediaPlayer.Ctlcontrols.next(); // activates the next button
                             //WMPLib.IWMPMedia media = mediaPlayer.newMedia(fullPathOfYourSecondMedia);
                             //mediaPlayer.currentPlaylist.appendItem(media);
                         }
                         catch (Exception e)
                         {
                         }
                     }
                 }
             }
         }
     }
 }