Interface Client

All Known Implementing Classes:
Android, AndroidLite, AndroidMusic, AndroidTestsuite, Ios, MediaConnect, Music, MusicClient, NonMusicClient, StreamingNonMusicClient, TvHtml5Embedded, Web, WebEmbedded

public interface Client
The interface for a Client.
  • Field Details

  • Method Details

    • getPlayabilityStatus

      @NotNull default @NotNull Client.PlayabilityStatus getPlayabilityStatus(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser playabilityStatus, boolean throwOnNotOk) throws CannotBeLoaded
      Throws:
      CannotBeLoaded
    • getUnplayableReason

      @Nullable default @Nullable String getUnplayableReason(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser statusBlock)
    • findSelectedTrack

      @Nullable default @Nullable com.sedmelluq.discord.lavaplayer.track.AudioTrack findSelectedTrack(@NotNull @NotNull List<com.sedmelluq.discord.lavaplayer.track.AudioTrack> tracks, @Nullable @Nullable String selectedVideoId)
    • transformPlaybackUri

      @NotNull default @NotNull URI transformPlaybackUri(@NotNull @NotNull URI originalUri, @NotNull @NotNull URI resolvedPlaybackUri)
      Transforms a given playback URL as necessary. For example, you can add query parameters or resolve any challenge parameters that might be needed.
      Parameters:
      originalUri - The original stream URI. This will be completely unmodified, and is provided as it has been received from YouTube.
      resolvedPlaybackUri - The playback URI. This will have already been transformed by the SignatureCipherManager.
      Returns:
      The new playback URI.
    • buildAudioTrack

      @NotNull default @NotNull com.sedmelluq.discord.lavaplayer.track.AudioTrack buildAudioTrack(@NotNull @NotNull YoutubeAudioSourceManager source, @NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser json, @NotNull @NotNull String title, @NotNull @NotNull String author, long duration, @NotNull @NotNull String videoId, boolean isStream)
      Builds an audio track with the given parameters. Hint: You can use YoutubeAudioSourceManager.buildAudioTrack(AudioTrackInfo) to build a track with the given AudioTrackInfo.
      Parameters:
      source - The source responsible for this track.
      json - The video JSON. This can be used to extract extra metadata.
      title - The title of the video.
      author - The video uploader.
      duration - The duration of the video.
      videoId - The video identifier.
      isStream - Whether this video is a livestream.
      Returns:
      The built audio track.
    • getIdentifier

      @NotNull @NotNull String getIdentifier()
      Returns:
      The unique identifier for this client.
    • getPlayerParams

      @NotNull @NotNull String getPlayerParams()
    • getOptions

      @NotNull default @NotNull ClientOptions getOptions()
    • canHandleRequest

      boolean canHandleRequest(@NotNull @NotNull String identifier)
      Returns a boolean determining whether this client can be used to handle requests for the given identifier.
      Parameters:
      identifier - The resource identifier. Could be an arbitrary string or a URL.
      Returns:
      True, if this client can handle the request.
    • supportsFormatLoading

      default boolean supportsFormatLoading()
      Returns:
      True, if this client can be used for loading playback URLs.
    • setPlaylistPageCount

      void setPlaylistPageCount(int count)
    • loadFormats

      @Nullable @Nullable TrackFormats loadFormats(@NotNull @NotNull YoutubeAudioSourceManager source, @NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull @NotNull String videoId) throws CannotBeLoaded, IOException
      Loads streaming formats for a video.
      Parameters:
      source - The source manager responsible for this client.
      httpInterface - The interface to use for requests.
      videoId - The ID of the video to load formats for.
      Throws:
      CannotBeLoaded - If a video doesn't exist etc.
      IOException
    • loadVideo

      @Nullable @Nullable com.sedmelluq.discord.lavaplayer.track.AudioItem loadVideo(@NotNull @NotNull YoutubeAudioSourceManager source, @NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull @NotNull String videoId) throws CannotBeLoaded, IOException
      Loads a single video.
      Parameters:
      source - The source manager responsible for this client.
      httpInterface - The interface to use for requests.
      videoId - The ID of the video to load.
      Returns:
      An AudioItem.
      Throws:
      CannotBeLoaded - If a video doesn't exist etc.
      IOException
    • loadSearch

      @Nullable @Nullable com.sedmelluq.discord.lavaplayer.track.AudioItem loadSearch(@NotNull @NotNull YoutubeAudioSourceManager source, @NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull @NotNull String searchQuery) throws CannotBeLoaded, IOException
      Loads search results for a query.
      Parameters:
      source - The source manager responsible for this client.
      httpInterface - The interface to use for requests.
      searchQuery - The search query.
      Returns:
      An AudioItem.
      Throws:
      CannotBeLoaded - If a video doesn't exist etc.
      IOException
    • loadSearchMusic

      @Nullable @Nullable com.sedmelluq.discord.lavaplayer.track.AudioItem loadSearchMusic(@NotNull @NotNull YoutubeAudioSourceManager source, @NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull @NotNull String searchQuery) throws CannotBeLoaded, IOException
      Loads search results for a query.
      Parameters:
      source - The source manager responsible for this client.
      httpInterface - The interface to use for requests.
      searchQuery - The search query.
      Returns:
      An AudioItem.
      Throws:
      CannotBeLoaded - If a video doesn't exist etc.
      IOException
    • loadMix

      @Nullable @Nullable com.sedmelluq.discord.lavaplayer.track.AudioItem loadMix(@NotNull @NotNull YoutubeAudioSourceManager source, @NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull @NotNull String mixId, @Nullable @Nullable String selectedVideoId) throws CannotBeLoaded, IOException
      Loads a mix playlist.
      Parameters:
      source - The source manager responsible for this client.
      httpInterface - The interface to use for requests.
      mixId - The ID of the mix.
      Returns:
      An AudioItem.
      Throws:
      CannotBeLoaded - If a video doesn't exist etc.
      IOException
    • loadPlaylist

      @Nullable @Nullable com.sedmelluq.discord.lavaplayer.track.AudioItem loadPlaylist(@NotNull @NotNull YoutubeAudioSourceManager source, @NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull @NotNull String playlistId, @Nullable @Nullable String selectedVideoId) throws CannotBeLoaded, IOException
      Loads a playlist.
      Parameters:
      source - The source manager responsible for this client.
      httpInterface - The interface to use for requests.
      playlistId - The ID of the playlist.
      Returns:
      An AudioItem.
      Throws:
      CannotBeLoaded - If a video doesn't exist etc.
      IOException