Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented showAllVideos #75

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions java/src/main/java/com/google/VideoPlayer.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.google;

import java.util.Map;
import java.util.TreeMap;

public class VideoPlayer {

private final VideoLibrary videoLibrary;
Expand All @@ -12,12 +15,18 @@ public void numberOfVideos() {
System.out.printf("%s videos in the library%n", videoLibrary.getVideos().size());
}

public void showAllVideos() {
System.out.println("showAllVideos needs implementation");
public String showAllVideos() {
System.out.println("Here's a list of all available videos:");
Map<String, String> myvideos = new TreeMap<>();
for (Video video : videoLibrary.getVideos()) {
System.out.println(video.getTitle() + " " + (video.getVideoId()) + " " + video.getTags());
}
return videoLibrary.toString();
}

public void playVideo(String videoId) {
System.out.println("playVideo needs implementation");
//System.out.println("playVideo needs implementation");
System.out.println(videoLibrary.getVideo(videoId));
}

public void stopVideo() {
Expand Down