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