Last active
May 29, 2019 07:25
-
-
Save ellehallal/5b14d671de3d3dc71c4186ba8e8746c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class VideoPlayer implements MediaPlayer{ | |
private String videoName; | |
private boolean isPlaying = false; | |
public VideoPlayer(String videoName) { | |
this.videoName = videoName | |
} | |
@Override | |
public void play() { | |
System.out.println("Playing..."); | |
isPlaying = true; | |
} | |
@Override | |
public void stop() { | |
System.out.println("Stopped"); | |
isPlaying = false; | |
} | |
@Override | |
public void currentlyPlaying() { | |
if (isPlaying) { | |
System.out.println(videoName + " is currently playing."); | |
} | |
else { | |
System.out.println(videoName + "is not playing. Press play"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment