MCPcopy Create free account
hub / github.com/Vanilagy/webcodecs-polyfill / configure

Method configure

src/audio_decoder.ts:126–140  ·  view source on GitHub ↗

* Configures the decoder with the given configuration.

(config: AudioDecoderConfig)

Source from the content-addressed store, hash-verified

124 * Configures the decoder with the given configuration.
125 */
126 configure(config: AudioDecoderConfig) {
127 // Spec: If [[state]] is "closed", throw an InvalidStateError.
128 if (this._state === 'closed') {
129 throw new DOMException('Cannot configure a closed decoder', 'InvalidStateError');
130 }
131
132 // Spec: Set [[state]] to "configured".
133 this._state = 'configured';
134 // Spec: Set [[key chunk required]] to true.
135 this._keyChunkRequired = true;
136
137 // Spec: Queue a control message to configure the decoder...
138 this.configureInternal(config)
139 .catch(e => this.handleAsyncError(e));
140 }
141
142 private async configureInternal(config: AudioDecoderConfig) {
143 const currentConfigId = this.currentConfigId;

Callers 4

Calls 2

configureInternalMethod · 0.95
handleAsyncErrorMethod · 0.95

Tested by

no test coverage detected