Audio pause()Method

Audio 对象参考手册Audio Object

Example

An audio clip with play and pause buttons:

var x = document.getElementById("myAudio");

function playAudio()
{
     x.play();
}

function pauseAudio()
{
     x.pause();
}

Try it Yourself »

Definition and Usage

The pause() method stops (pauses) the currently playing audio or video.

Tip:This method is usually used together withplay()the play() method.

Tip:Use thecontrolscontrols property to display audio controls (such as on audio: play, pause, seeking, volume, etc.).


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the pause() method.

Note:Internet Explorer 8 or earlier browsers do not support this method.


Syntax

audioObject.pause()

Parameters

None

Return Value

No return value.


Audio 对象参考手册Audio Object Other extensions