Package dev.arbjerg.lavalink.api
Interface IPlayer
-
- All Implemented Interfaces:
public interface IPlayerRepresents an audio player for a specific guild. Contains track data and is used for controlling playback.
-
-
Method Summary
Modifier and Type Method Description abstract Unitplay(AudioTrack track)Starts playing track, potentially replacing an existing one. abstract Unitstop()Stops playing the current track, if any. abstract UnitsetPause(Boolean pause)Sets the pause state to pause. abstract UnitseekTo(Long position)Seeks to position. UnitseekTo(Duration position)Seeks to position. abstract UnitsetVolume(Integer volume)Sets the volume to volume. abstract AudioPlayergetAudioPlayer()abstract AudioTrackgetTrack()The currently playing track if any. abstract LonggetGuildId()The guild which this player belongs to. abstract ISocketContextgetSocketContext()The WebSocket this player belongs to abstract BooleanisPlaying()Whether the player is trying to produce audio. -
-
Method Detail
-
play
abstract Unit play(AudioTrack track)
Starts playing track, potentially replacing an existing one.
-
seekTo
abstract Unit seekTo(Long position)
Seeks to position.
- Parameters:
position- the new position of the current track in milliseconds
-
setVolume
abstract Unit setVolume(Integer volume)
Sets the volume to volume.
- Parameters:
volume- in percentage 0% to 1000%
-
getAudioPlayer
abstract AudioPlayer getAudioPlayer()
-
getTrack
abstract AudioTrack getTrack()
The currently playing track if any.
-
getGuildId
abstract Long getGuildId()
The guild which this player belongs to. Immutable
-
getSocketContext
abstract ISocketContext getSocketContext()
The WebSocket this player belongs to
-
-
-
-