Advertisement
Home Open Editor ❯

HTML Audio/Video DOM play() Method

Example

var vid = document.getElementById("myVideo"); 

function playVideo() { 
  vid.play(); 
} 

function pauseVideo() { 
  vid.pause(); 
} 

Try this code ❯

Meaning

The play() method play the audio or video and use the pause() method to pause the current audio/video.


Standard Syntax

audio|video.play()


Advertisement

Parameter Value

None.

Home Open Editor ❯
Advertisement