|
|
|
@ -2,15 +2,13 @@ package adapter.media.player;
|
|
|
|
|
|
|
|
|
|
public class AudioPlayer implements MediaPlayer {
|
|
|
|
|
|
|
|
|
|
private MediaAdapter mediaAdapter;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void play(String audioType, String fileName) {
|
|
|
|
|
|
|
|
|
|
if (audioType.equalsIgnoreCase("mp3")) {
|
|
|
|
|
System.out.println("Playing MP3 File | Name: " + fileName);
|
|
|
|
|
} else if (audioType.equalsIgnoreCase("mp4") || audioType.equalsIgnoreCase("vlc")) {
|
|
|
|
|
mediaAdapter = new MediaAdapter(audioType);
|
|
|
|
|
MediaAdapter mediaAdapter = new MediaAdapter(audioType);
|
|
|
|
|
mediaAdapter.play(audioType, fileName);
|
|
|
|
|
} else {
|
|
|
|
|
System.out.printf("Media Format '%s' Not Recognised!", audioType);
|
|
|
|
|