This article needs a technical review. How you can help.

The oncanplay property sets and returns the event handler for the canplay event.


element.oncanplay = handlerFunction;
var handlerFunction = element.oncanplay;

handlerFunction should be either null or a JavaScript function specifying the handler for the event.


See the DOM event handlers page for information on working with on... handlers.

The canplay event is fired when the user agent can play the media but estimates that not enough data has been loaded to play the media up to its end without having to stop for further buffering of content.


Specification Status Comment
WHATWG HTML Living Standard
The definition of 'canplay' in that specification.
Living Standard  

Document Tags and Contributors

 Contributors to this page: rolfedh, Guillaume-Heras
 Last updated by: rolfedh,