Chrome 45 Beta introduces a handy new feature for controlling audio and video playback.
When an audio or video element is playing on a web page, a notification showing the page title and a play/pause button is displayed in the notification tray and on the lock screen. The notification can be used to pause or resume play, and to quickly return to the page that is playing the media.
Great for controlling music apps and for many other audio and video use cases.
Here’s an animated GIF of a notification displayed over a web page:
This animation shows a notification over the Android lock screen:
The screencast below shows the process of displaying a notification and controlling video playback on a web page:
Note that:
- The lock screen notification is currently only shown in Android L and later. Support for J and K devices is in progress.
- Notifications are only shown for media over five seconds in length.
- There is no notification for audio from the Web Audio API unless it is played back via an audio element.
We are currently working on implementing the MediaSession API. Although this looks like a simple addition to Chrome, it will be the basis for implementation of future media control APIs. MediaSession will enable control over media in a web page, such as the ability to move between tracks or display extra metadata about the currently playing track. You could imagine that this API might be integrated with platforms such as Android Wear, or even enable remote controls on Bluetooth devices to extend the reach of web experiences.
We welcome your feedback on the MediaSession API. You can follow the Intent to Implement discussion, comment on the WHATWG standard, or track our implementation bug.