* Configures the decoder with the given configuration.
(config: VideoDecoderConfig)
| 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; |
nothing calls this directly
no test coverage detected