Class YoutubeSearchEngine
java.lang.Object
org.prithvidiamond1.AudioPlayer.Youtube.YoutubeSearchEngine
Class that implements methods for using the YouTube Search Engine API
-
Field Summary
Modifier and TypeFieldDescriptioncom.google.api.services.youtube.YouTube
The YouTube service API instance -
Constructor Summary
ConstructorDescriptionConstructor that initializes the search engine API service -
Method Summary
Modifier and TypeMethodDescriptioncom.google.api.services.youtube.model.SearchResult
getBestSearchResult
(String searchString) Method that returns the best YouTube search result based on a search stringcom.google.api.services.youtube.model.VideoSnippet
getVideoSnippetById
(String videoId) Method that gets a YouTube video snippet based on its video ID
-
Field Details
-
youtube
public com.google.api.services.youtube.YouTube youtubeThe YouTube service API instance
-
-
Constructor Details
-
YoutubeSearchEngine
public YoutubeSearchEngine()Constructor that initializes the search engine API service
-
-
Method Details
-
getBestSearchResult
Method that returns the best YouTube search result based on a search string- Parameters:
searchString
- a user defined search string- Returns:
- the best YouTube search result
-
getVideoSnippetById
Method that gets a YouTube video snippet based on its video ID- Parameters:
videoId
- the YouTube video's ID- Returns:
- a video snippet of the YouTube video
-