This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Specification: https://html.spec.whatwg.org/ Multipage: https://html.spec.whatwg.org/multipage/#media-elements Complete: https://html.spec.whatwg.org/#media-elements Referrer: Comment: Provide a hook for media session integration (blocking paused->playing transition) Posted from: 212.116.72.179 User agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2327.5 Safari/537.36 OPR/30.0.1820.0 (Edition developer)
High-level summary of media sessions <https://mediasession.spec.whatwg.org/>: A media session is the glue between one or more media elements and a system's audio focus system. The audio focus system (on Android/iOS) is what allows apps to play nicely with each other, pausing when another app begins playback, etc. The spec is still in the early stages, but we expect media sessions to also be involved in providing title/background/etc for lockscreen controls and various media key events. More exhaustive use cases in <https://github.com/whatwg/mediasession#use-cases>. To make this work, we need an integration point with media elements. Any time that a media elements goes from paused to playing (really playing, not just potentially) we need to asynchronously activate a media session, something which can fail in case there's a high-priority audio stream (e.g. phone call) on the system. There are several ways to do this, but it in any solution I think it makes sense to queue the play and canplay and events, but withhold the playing event until actually playing, which may never happen. When it's not possible to activate the media session, one also needs to return the media element(s) to a sane state, which probably amounts to calling pause(). As for how to signal this failure, we think it would make a lot of sense to have play() return a promise, which would be rejected in this scenario. Many open questions, please let us know if none of this makes any sense to you.
With the W3C Bugzilla shutting down, and Media Sessions having not seen much spec movement in a while from what I can tell, I'll close this issue. Please reopen against whatwg/html if it's still relevant!