VideoDecoder: flush() method
WebCodecs APIwindowanddedicated
WebCodecs APIwindow_and_dedicated
The **`flush()`** method of the VideoDecoder interface returns a Promise that resolves once all pending messages in the queue have been completed.
## Syntax
```js-nolint
flush()
```
### Parameters
None.
### Return value
A Promise that resolves with undefined.
### Exceptions
- `InvalidStateError` DOMException
- : Returned if the Promise is rejected because the state is not `configured`.
## Examples
The following example flushes the `VideoDecoder`.
```js
VideoDecoder.flush();
```
## Specifications
## Browser compatibility
source: MDN Web Docs mirror · page
Cite this
"VideoDecoder: flush() method". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/flush