* Configures the decoder with the given configuration.
(config: AudioDecoderConfig)
| 124 | * Configures the decoder with the given configuration. |
| 125 | */ |
| 126 | configure(config: AudioDecoderConfig) { |
| 127 | // Spec: If [[state]] is "closed", throw an InvalidStateError. |
| 128 | if (this._state === 'closed') { |
| 129 | throw new DOMException('Cannot configure a closed decoder', 'InvalidStateError'); |
| 130 | } |
| 131 | |
| 132 | // Spec: Set [[state]] to "configured". |
| 133 | this._state = 'configured'; |
| 134 | // Spec: Set [[key chunk required]] to true. |
| 135 | this._keyChunkRequired = true; |
| 136 | |
| 137 | // Spec: Queue a control message to configure the decoder... |
| 138 | this.configureInternal(config) |
| 139 | .catch(e => this.handleAsyncError(e)); |
| 140 | } |
| 141 | |
| 142 | private async configureInternal(config: AudioDecoderConfig) { |
| 143 | const currentConfigId = this.currentConfigId; |
no test coverage detected