public void Play(string audioType, string fileName)
 {
     if (audioType.Equals("mp3"))
     {
         Console.WriteLine($"Playing mp3 file. Name:{fileName}");
     }
     else if (audioType.Equals("vlc") || audioType.Equals("mp4"))
     {
         mediaAdapter = new MediaAdapter(audioType);
         mediaAdapter.Play(audioType, fileName);
     }
     else
     {
         Console.WriteLine($"Invalid media.{audioType} format not supported");
     }
 }
Example #2
0
 public bool Play(string audioType, string fileName)
 {
     if (audioType == "mp3")
     {
         Console.WriteLine("Playing mp3 file. Name: " + fileName);
     }
     else if (audioType == "vlc" || audioType == "mp4")
     {
         _MediaAdapter = new MediaAdapter(audioType);
         _MediaAdapter.Play(audioType, fileName);
     }
     else
     {
         throw new ArgumentException(string.Format("Invalid media. {0} format not supported", audioType), "audioType");
     }
     return(true);
 }