Latest web development tutorials

HTML Audio / Video DOM play () method

HTML audio / video Tag Reference HTML Audio / Video DOM Reference

Examples

A video with a play and pause button:

var myVideo=document.getElementById("video1");
function playVid()
{
myVideo.play();
}
function pauseVid()
{
myVideo.pause();
}

try it"

Definition and Usage

play () method to start playing the current audio or video.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the play () method.

Note: 8 and earlier versions of Internet Explorer does not support this method.


grammar

audio|video .play()


HTML audio / video Tag Reference HTML Audio / Video DOM Reference