GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

VideoEncoder: flush() method

WebCodecs APIwindowanddedicated

WebCodecs APIwindow_and_dedicated

The **`flush()`** method of the VideoEncoder interface forces all pending encodes to complete.

## Syntax

```js-nolint
flush()
```

### Parameters

None.

### Return value

A Promise that resolves once the encoder's initialization is completed and all pending EncodedVideoChunks are returned.

### Exceptions

- `InvalidStateError` DOMException
- : Returned if the Promise is rejected because the state is not `configured`.

## Examples

The following example flushes the `VideoEncoder`.

```js
VideoEncoder.flush();
```

## Specifications

## Browser compatibility

source: MDN Web Docs mirror · page

Cite this

"VideoEncoder: flush() method". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/flush

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·