Search w3schools.com:

SHARE THIS PAGE

HTML Audio/Video DOM play() Method

HTML audio Tag Reference HTML Audio/Video DOM Reference

Example

A video with play and pause buttons:

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

Try it yourself »

Definition and Usage

The play() method starts playing the current audio or video.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The play() method is supported in all major browsers.

Note: This method is not supported in Internet Explorer 8 and earlier.


Syntax

audio|video.play()


HTML audio Tag Reference HTML Audio/Video DOM Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]