Video play() method
Example
A video with play and pause buttons:
var
x
=
document
.
getElementById
(
"
myVideo
"
)
;
function
playVid
(
)
{
x
.
play
(
)
;
}
function
pauseVid
(
)
{
x
.
pause
(
)
;
}
Try it »
Definition and Usage
The play() method starts playing the current audio or video.
**Tip:** This method is usually used together with pause() the method.
**Tip:** Use controls attribute to display video controls (such as play, pause, seek, volume, etc.).
Browser support





All major browsers support the play() method
Note: Internet Explorer 8 and earlier IE versions do not support this method.
Syntax
videoObject
.play()
Parameters
| None |
|---|
Return Value
| No return value |
|---|
The Video object