Class YoutubeSearchEngine

java.lang.Object
org.prithvidiamond1.AudioPlayer.Youtube.YoutubeSearchEngine

public class YoutubeSearchEngine extends Object
Class that implements methods for using the YouTube Search Engine API
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    com.google.api.services.youtube.YouTube
    The YouTube service API instance
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor that initializes the search engine API service
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.api.services.youtube.model.SearchResult
    Method that returns the best YouTube search result based on a search string
    com.google.api.services.youtube.model.VideoSnippet
    Method that gets a YouTube video snippet based on its video ID

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • youtube

      public com.google.api.services.youtube.YouTube youtube
      The YouTube service API instance
  • Constructor Details

    • YoutubeSearchEngine

      public YoutubeSearchEngine()
      Constructor that initializes the search engine API service
  • Method Details

    • getBestSearchResult

      public com.google.api.services.youtube.model.SearchResult getBestSearchResult(String searchString)
      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

      public com.google.api.services.youtube.model.VideoSnippet getVideoSnippetById(String videoId)
      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