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

Method configure

src/video_decoder.ts:177–191  ·  view source on GitHub ↗

* Configures the decoder with the given configuration.

(config: VideoDecoderConfig)

Source from the content-addressed store, hash-verified

175 * Configures the decoder with the given configuration.
176 */
177 configure(config: VideoDecoderConfig) {
178 // Spec 4.5: If [[state]] is "closed", throw an InvalidStateError.
179 if (this._state === 'closed') {
180 throw new DOMException('Cannot configure a closed decoder', 'InvalidStateError');
181 }
182
183 // Spec 4.5: Set [[state]] to "configured".
184 this._state = 'configured';
185 // Spec 4.5: Set [[key chunk required]] to true.
186 this.keyChunkRequired = true;
187
188 // Spec 4.5: Queue a control message to configure the decoder...
189 this.configureInternal(config)
190 .catch(e => this.handleAsyncError(e));
191 }
192
193 private async configureInternal(config: VideoDecoderConfig) {
194 const currentConfigId = this.currentConfigId;

Callers

nothing calls this directly

Calls 2

configureInternalMethod · 0.95
handleAsyncErrorMethod · 0.95

Tested by

no test coverage detected