Discord Player

ExtractorExecutionContext

Small legacy ownership adapter; all execution goes through player.plugins.

You are reading the v8 docsDev
ClassTypeScript@discord-player/plugin-host
View sourcepackages/plugin-host/src/compat/extractor-execution-context.ts:11
class ExtractorExecutionContext

Small legacy ownership adapter; all execution goes through player.plugins.

Constructors

constructor

constructor(player: LegacyPlayerContext)

Create an adapter owned by one Player.

Parameters

NameTypeDescription
playerLegacyPlayerContext

Owning Player.

Properties

playerreadonly

readonly player: LegacyPlayerContext

Player owning legacy registrations.

Accessors

storereadonly

readonly get store(): ReadonlyMap<string, BaseExtractor<any>>

Read-only view of registered legacy instances.

Returns

ReadonlyMap<string, BaseExtractor<any>>

sizereadonly

readonly get size(): number

Number of legacy registrations.

Returns

number

Methods

get

get(id: string): BaseExtractor<any> | undefined

Look up a legacy registration.

Parameters

NameTypeDescription
idstring

Extractor identifier.

Returns

BaseExtractor<any> | undefined

isRegistered

isRegistered(id: string): boolean

Test legacy registration membership.

Parameters

NameTypeDescription
idstring

Extractor identifier.

Returns

boolean

isDisabled

isDisabled(id: string): boolean

Check the Player block list.

Parameters

NameTypeDescription
idstring

Extractor identifier.

Returns

boolean

isEnabled

isEnabled(id: string): boolean

Check whether a source is allowed.

Parameters

NameTypeDescription
idstring

Extractor identifier.

Returns

boolean

register

register<C extends ExtractorConstructor>(
  Extractor: C,
  ...args: {} extends ConstructorParameters<C>[1] ? [options: ConstructorParameters<C>[1]?] : [options: ConstructorParameters<C>[1]],
): Promise<InstanceType<C>>

Register a legacy class through a source plugin.

Parameters

NameTypeDescription
ExtractorC

Legacy BaseExtractor subclass constructor.

...args{} extends ConstructorParameters<C>[1] ? [options: ConstructorParameters<C>[1]?] : [options: ConstructorParameters<C>[1]]

Returns

Promise<InstanceType<C>>

The owned compatibility instance.

unregister

unregister(extractor: string | BaseExtractor<any>): Promise<boolean>

Remove an extractor and its source subscriptions.

Parameters

NameTypeDescription
extractorstring | BaseExtractor<any>

ID or owned instance.

Returns

Promise<boolean>

unregisterAll

unregisterAll(): Promise<void>

Remove all legacy registrations.

Returns

Promise<void>

reconfigure

reconfigure(id: string, options: object): Promise<BaseExtractor<any>>

Replace an instance through the same registration path.

Parameters

NameTypeDescription
idstring

Legacy ID.

optionsobject

Replacement options.

Returns

Promise<BaseExtractor<any>>

loadMulti

loadMulti(
  bundle: readonly ExtractorConstructor[],
  options: Record<string, object> = {},
): Promise<void>

Register a bundle sequentially with deterministic precedence.

Parameters

NameTypeDescription
bundlereadonly ExtractorConstructor[]

Legacy constructors.

optionsRecord<string, object>Default: {}

Options keyed by identifier.

Returns

Promise<void>

requestBridge

requestBridge(
  track: Track,
  sourceExtractor: BaseExtractor<any> | null = track.extractor,
): Promise<{
  result: SourceStream;
  error: null;
  extractor: BaseExtractor<any> | null;
}>

Request explicit bridge fallback using the shared registry.

Parameters

NameTypeDescription
trackTrack

Track needing a bridge.

sourceExtractorBaseExtractor<any> | nullDefault: track.extractor

Original provider.

Returns

Promise<{
result: SourceStream;
error: null;
extractor: BaseExtractor<any> | null;
}>

On this page