Skip to content

BaseDispatcher

classe · SourceExtends: Writable

Properties

player

player: MediaPlayer

The Player that controls this dispatcher Source

pausedSince

nullable

pausedSince: number

The time that the stream was paused at (null if not paused) Source

paused

readonly

paused: boolean

Whether or not playback is paused Source

pausedTime

readonly

pausedTime: number

Total time that this dispatcher has been paused in milliseconds Source

totalStreamTime

readonly

totalStreamTime: number

The time (in milliseconds) that the dispatcher has been playing audio for, taking into account skips and pauses Source

Methods

pause

pause(silence?: boolean)

Pauses playback Parameters

NameTypeDescription
silence?booleanWhether to play silence while paused to prevent audio glitches Default: false.
Source

resume

resume()

Resumes playback Source

createHeaderExtension

createHeaderExtension(): Buffer

Creates a one-byte extension header https://www.rfc-editor.org/rfc/rfc5285#section-4.2Returns: Buffer — <Buffer be de 00 01> Source

createPayloadExtension

createPayloadExtension(): Buffer

Creates a one-byte extension header & a single extension of type playout-delay Returns: Buffer — playout-delay extension <Buffer 51 00 00 00> Source

Events

error

error: unknown

Emitted when the dispatcher encounters an error. Source

start

start: unknown

Emitted once the stream has started to play. Source

debug

debug: unknown

Emitted whenever the dispatcher has debug information. Parameters

NameTypeDescription
infostringThe debug info
Source

Unofficial software. Not affiliated with or supported by Discord.