← Back to release summary

HTMLMediaElement.play() returns a promise

Category
Multimedia
Type
New or changed feature
Status
Enabled by default (Chrome 50)
Intent stage
None

Summary

This is allowing a simpler flow to know whether playback started or whether it failed. It also allows the UA to reject the promise if playback is not allowed in the current context, solving issues websites have to detect whether autoplay restrictions blocked the playback.

Standards & signals

Docs: https://developers.google.com/web/updates/2016/03/play-returns-promise

Samples: https://googlechrome.github.io/samples/play-return-promise/index.html

View on chromestatus.com