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

Method configure

src/video_encoder.ts:260–272  ·  view source on GitHub ↗

* Configures the encoder with the given configuration.

(config: VideoEncoderConfig)

Source from the content-addressed store, hash-verified

258 * Configures the encoder with the given configuration.
259 */
260 configure(config: VideoEncoderConfig) {
261 // Spec 6.5: If [[state]] is "closed", throw an InvalidStateError.
262 if (this._state === 'closed') {
263 throw new DOMException('Cannot configure a closed encoder', 'InvalidStateError');
264 }
265
266 // Spec 6.5: Set [[state]] to "configured".
267 this._state = 'configured';
268
269 // Spec 6.5: Queue a control message to configure the encoder...
270 this.configureInternal(config)
271 .catch(e => this.handleAsyncError(e));
272 }
273
274 private async configureInternal(config: VideoEncoderConfig) {
275 const currentConfigId = this.currentConfigId;

Callers

nothing calls this directly

Calls 2

configureInternalMethod · 0.95
handleAsyncErrorMethod · 0.95

Tested by

no test coverage detected