Esempio n. 1
0
 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"))
     {
         ma = new MediaAdapter(audioType);
         ma.play(audioType, fileName);
     }
 }
        public void Play(string fileName)
        {
            string fileExtension = fileName.Substring(fileName.LastIndexOf('.') + 1);

            if (fileExtension.Equals("mp3"))
            {
                MP3MediaPlayer mP3MediaPlayer = new MP3MediaPlayer();
                mP3MediaPlayer.Play(fileName);
            }
            else
            {
                MediaAdapter mediaAdapter = new MediaAdapter();
                mediaAdapter.Play(fileName);
            }
        }
Esempio n. 3
0
 public void Play(string FileType, string FileName)
 {
     if (FileType == "mp3")
     {
         Console.WriteLine("Playing mp3: " + FileName);
     }
     else if (FileType == "mp4" || FileType == "vlc")
     {
         mediaAdapter = new MediaAdapter(FileType);
         mediaAdapter.Play(FileType, FileName);
     }
     else
     {
         Console.WriteLine("Invalid File Type");
     }
 }
Esempio n. 4
0
 public void play(string audioType, string fileName)
 {
     if (audioType.Equals("mp3", StringComparison.OrdinalIgnoreCase))
     {
         Console.WriteLine("Play mp3: {0}", fileName);
     }
     else if (audioType.Equals("mp4", StringComparison.OrdinalIgnoreCase) || audioType.Equals("vlc", StringComparison.OrdinalIgnoreCase))
     {
         mediaAdapter = new MediaAdapter(audioType);
         mediaAdapter.play(audioType, fileName);
     }
     else
     {
         Console.WriteLine("Format does not support");
     }
 }
Esempio n. 5
0
 public void Play(string audioType, string file)
 {
     if (audioType == "mp3")
     {
         Console.WriteLine("Playing mp3 file: " + file);
     }
     else if (audioType == "vlc" || audioType == "mp4")
     {
         adapter = new MediaAdapter(audioType);
         adapter.Play(audioType, file);
     }
     else
     {
         Console.WriteLine("Invalid media. " + audioType + " format not supported!");
     }
 }
 public void play(string AudioType, string fileName)
 {
     if (AudioType.Equals("mp3", StringComparison.OrdinalIgnoreCase))
     {
         Console.WriteLine("Playing mp3 file.Name: " + fileName);
     }
     else if (AudioType.Equals("vlc", StringComparison.OrdinalIgnoreCase) || AudioType.Equals("mp4", StringComparison.OrdinalIgnoreCase))
     {
         mediaAdapter = new MediaAdapter(AudioType);
         mediaAdapter.play(AudioType, fileName);
     }
     else
     {
         Console.WriteLine("Invalid Media" + AudioType + "Format not supported"
                           );
     }
 }
Esempio n. 7
0
 public string play(string audioType, string fileName)
 {
     // inbuilt support to play mp3 music files
     if (audioType.Equals("mp3"))
     {
         return(string.Format("Playing mp3 file. Name: {0}", fileName));
     }
     else if (audioType.Equals("vlc") || audioType.Equals("mp4"))
     {
         // mediaAdapter is providing support to play other file formats
         this.mediaAdapter = new MediaAdapter(audioType);
         return(this.mediaAdapter.play(audioType, fileName));
     }
     else
     {
         return(string.Format("Invalid media {0} format not supported", audioType));
     }
 }