Discord Player

SourcePluginHost

Source runtime and the published Remedia transport sharing one set of handlers.

You are reading the v8 docsDev
ClassTypeScript@discord-player/plugin-host
View sourcepackages/plugin-host/src/host.ts:54
class SourcePluginHost

Source runtime and the published Remedia transport sharing one set of handlers.

Constructors

constructor

constructor(options: SourcePluginHostOptions)

Create a host without starting a listener.

Parameters

NameTypeDescription
optionsSourcePluginHostOptions

Transport and source settings.

Properties

runtimereadonly

readonly runtime: SourcePluginRuntime

Source execution independent of transport.

pluginsreadonly

readonly plugins: PluginRegistry

Canonical source plugin registry.

extractorsreadonly

readonly extractors: ExtractorExecutionContext

Legacy constructor registration adapter.

remediareadonly

readonly remedia: PluginHost<PluginOperations>

Underlying generic host; exposes discovery, middleware matching and transport.

hostIdreadonly

readonly hostId: string

Stable deployment identity, independent of provider identifiers and network addresses.

Methods

handle

handle(request: PluginRequest): Promise<ExecuteResult>

Execute directly without serialization; caller owns returned media.

Parameters

NameTypeDescription
requestPluginRequest

Generic Remedia request targeting discord-player.source.

Returns

Promise<ExecuteResult>

fetch

fetch(request: Request): Promise<Response>

Execute HTTP through Remedia's transport and the same operation handlers.

Parameters

NameTypeDescription
requestRequest

Fetch request. An explicitly configured hostId is required even without publicUrl.

Returns

Promise<Response>

matches

matches(path: string): boolean

Identify Remedia routes for Node middleware.

Parameters

NameTypeDescription
pathstring

URL pathname.

Returns

boolean

close

close(): Promise<void>

Cancel media and operations, release state, and destroy sources.

Returns

Promise<void>

On this page