Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / JavaScript

HTMLMediaElement.pause() — pausing playback

The pause() method pauses an audio or video element without rewinding it. It takes no arguments and returns undefined. The paused state changes synchronously, whereas the pause event is dispatched later.

Version: ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support

Syntax

media.pause()

HTMLMediaElement.pause is a browser Web API method inherited by audio and video elements. Call media.pause() on a media element. The method takes no arguments and returns undefined, not a promise. It is not part of ECMAScript itself; having Node.js in a project does not establish its availability.

If paused is false, the method synchronously sets it to true. It does not rewind playback. To resume playback, use play(). Calling pause() again on an already-paused element does not generate another pause event.

When the state changes, the browser queues a task that dispatches timeupdate followed by pause; these events are not dispatched before the method returns. After dispatching both events, the task rejects with AbortError only the promises returned by play() that were still in the element’s pending play promises list when the pause() algorithm took that list. A promise already taken from that list for a queued task that dispatches playing can still resolve. Handle rejections of promises returned by play(). If networkState is NETWORK_EMPTY, pause() also invokes the resource selection algorithm — do not treat this method as a download cancellation mechanism.

The example deliberately uses a new element without a source, which starts with paused === true. It demonstrates the return value and safe repeated calls, but does not demonstrate interruption of active playback.

Examples

const media = document.createElement('video');
const result = media.pause();
console.log(media.paused);
console.log(result === undefined);
media.pause();
console.log(media.paused);

Result

true
true
true

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources