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

Method configure

src/audio_encoder.ts:184–196  ·  view source on GitHub ↗

* Configures the encoder with the given configuration.

(config: AudioEncoderConfig)

Source from the content-addressed store, hash-verified

182 * Configures the encoder with the given configuration.
183 */
184 configure(config: AudioEncoderConfig) {
185 // Spec: If [[state]] is "closed", throw an InvalidStateError.
186 if (this._state === 'closed') {
187 throw new DOMException('Cannot configure a closed encoder', 'InvalidStateError');
188 }
189
190 // Spec: Set [[state]] to "configured".
191 this._state = 'configured';
192
193 // Spec: Queue a control message to configure the encoder...
194 this.configureInternal(config)
195 .catch(e => this.handleAsyncError(e));
196 }
197
198 private async configureInternal(config: AudioEncoderConfig) {
199 const currentConfigId = this.currentConfigId;

Callers

nothing calls this directly

Calls 2

configureInternalMethod · 0.95
handleAsyncErrorMethod · 0.95

Tested by

no test coverage detected