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 {
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);

Loading…
Cancel
Save