Discord Player

SourcePluginRuntime

Shared source execution and compatibility facade, independent of audio and Discord clients.

You are reading the v8 docsDev
ClassTypeScript@discord-player/plugin-host
View sourcepackages/plugin-host/src/runtime.ts:29
class SourcePluginRuntime extends SafeEventEmitter<SourceRuntimeEvents> implements LegacyPlayerContext

Shared source execution and compatibility facade, independent of audio and Discord clients.

Constructors

constructoroverride

constructor(options: SourcePluginRuntimeOptions = {})

Create a source runtime.

Parameters

NameTypeDescription
optionsSourcePluginRuntimeOptionsDefault: {}

Source settings and optional embedding context.

Properties

pluginsreadonly

Implementation of LegacyPlayerContext.plugins

readonly plugins: PluginRegistry

Canonical operation registry and lifecycle owner.

extractorsreadonly

Implementation of LegacyPlayerContext.extractors

readonly extractors: ExtractorExecutionContext

Legacy constructor adapter sharing the same registry.

playerreadonly

readonly player: LegacyPlayerContext

Actual Player or this runtime's source facade.

optionsreadonly

Implementation of LegacyPlayerContext.options

readonly options: {
  blockExtractors?: readonly string[];
  probeTimeout?: number;
}

Source compatibility options.

Methods

getRemedia

Implementation of LegacyPlayerContext.getRemedia

getRemedia(): RemediaClient

Required audio access is unavailable in standalone execution.

Returns

RemediaClient

getRemedia(throwOnMissing: false): RemediaClient | null

Optional audio access returns null.

Parameters

NameTypeDescription
throwOnMissingfalse

Optional lookup flag.

Returns

RemediaClient | null

debug

Implementation of LegacyPlayerContext.debug

debug(message: string): void

Emit a source diagnostic.

Parameters

NameTypeDescription
messagestring

Diagnostic text.

Returns

void

destroy

destroy(): Promise<void>

Release source registrations and active streams.

Returns

Promise<void>

Implementation of LegacyPlayerContext.search

search(query: MediaResource, options: SearchOptions = {}): Promise<SearchResult>

Search using the same routing policy in embedded and standalone execution.

Parameters

NameTypeDescription
queryMediaResource

Query or existing metadata.

optionsSearchOptionsDefault: {}

Source targeting and cancellation.

Returns

Promise<SearchResult>

On this page