Video play() Method
Definition and Usage
play()
method to start playing the current video.
Tip:This method is usually used with pause() method Use together.
Tip:Please use controls attribute Display video controls (such as play, pause, search, volume, etc.).
Example
Video with play and pause buttons:
var x = document.getElementById("myVideo"); function playVid() { x.play(); } function pauseVid() { x.pause(); }
Syntax
videoObject.play()
Parameters
None.
Return Value
No Return Value.
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | 9.0 | Support | Support | Support |