Class LavalinkPlayer

  • All Implemented Interfaces:
    dev.arbjerg.lavalink.client.player.IUpdatablePlayer

    
    public final class LavalinkPlayer
     implements IUpdatablePlayer
                        

    Represents a player that is tied to a guild.

    • Constructor Detail

      • LavalinkPlayer

        LavalinkPlayer(LavalinkNode node, Player protocolPlayer)
    • Method Detail

      • setTrack

         PlayerUpdateBuilder setTrack(Track track)

        Shortcut for setting the encoded track. This will also send any user-data supplied. Please keep in mind that this will set the position field to the current position of the track.

        Returns:

        The updated builder, useful for chaining

      • stopTrack

         PlayerUpdateBuilder stopTrack()

        Shortcut for setting the encoded track to {@code null}. This will also clear the user data.

        Returns:

        The updated builder, useful for chaining

      • omitEndTime

         PlayerUpdateBuilder omitEndTime()

        Omits the end time from being sent to the node during updates.

        Returns:

        The updated builder, useful for chaining

      • setVolume

         PlayerUpdateBuilder setVolume(Integer volume)

        Update the volume of the player. While you could use the filters to set volume as well, do note that that is float based (1.0f is 100% volume) and takes the time of your buffer size to apply. This method updates the volume instantly after the update is sent out.

        Returns:

        The updated builder, useful for chaining

      • setFilters

         PlayerUpdateBuilder setFilters(Filters filters)

        Update the filters for the player. Please use setVolume to update the player's volume instead. Setting the volume via filters is float based (1.0f is 100% volume) and takes the time of your buffer size to apply.

        Returns:

        The updated builder, useful for chaining

      • setVoiceState

         PlayerUpdateBuilder setVoiceState(VoiceState state)

        Update the voice state for the player.<br> <strong>IMPORTANT:</strong> Only ever use Link.onVoiceServerUpdate to update the voice server as this sets the state of the link to LinkState.CONNECTING

        Returns:

        The updated builder, useful for chaining