Use local variable

master
Hammy 4 years ago
parent 1e0d93fa6a
commit 96311a1ff4

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

Loading…
Cancel
Save