play method
Loads and starts playback of a media resource.
![]() ![]() |
Syntax
HRESULT retVal = object.play();
Parameters
This method has no parameters.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Standards information
- HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 4.8.9.8
Remarks
To change the URL that is currently playing, assign it to IHTMLMediaElement::src. This method sets IHTMLMediaElement::paused to FALSE. To change the URL using the source element, call IHTMLMediaElement::load before calling IHTMLMediaElement::play.
See also
- How to use HTML5 to play video files on your webpage
- How to use HTML5 to Add an Audio Player to your Webpage
- Make your videos accessible with Timed Text Tracks
Build date: 11/12/2012

