State of Media Playback
summary
Explains exactly what to implement: request and abandon audio focus, handle becoming noisy broadcast, and use the Support Library helpers. Uses MediaPlayer or third‑party backends but recommends MediaSessionCompat (set flags, setActive) and PlaybackStateCompat actions so Bluetooth/headset buttons and Android Wear/Auto work. Covers the media button receiver (Support Lib 23.1), MediaStyle notification with cancel button to work around pre‑Lollipop stopForeground bugs, MediaBrowserService for browsing and session tokens, and running as a foreground service.
AI-written summary · about
chapters (16)
- 0:00Intro
- 1:54User Expectations
- 3:33Media Playback Events
- 5:19Audio Focus
- 7:55Audio Focus Loss
- 10:17Loss Transient
- 11:44Updated Life Cycle
- 12:48Becoming Noisy
- 14:36Media Buttons
- 17:39Media Session Compat
- 19:51Set Active
- 22:31Lock Screen Controls
- 26:07Notifications Helper
- 29:17Media Style
- 31:03Foreground Services
- 33:12Media Controller Compact
related talks
16mUnderstanding and Implementing Audio on Android
22mBuilding media apps on Wear OS
42mLet's make some noise with Android
22mBuilding media apps on Wear OS
26mUnderstanding and Implementing Audio on Android
16mGo the extra mile for your media app on Android
25mHow to Build a Video Playback App in 2022
18mPresenting a high-quality media experience for all users
