Solution to traditional approach - devrath/MediaAlchemySuite GitHub Wiki

overview

Adding a Media Session

Connecting your player to a media session allows you

  • To expose what you are currently playing.
  • Allows you to control your player from outside your app.

What benefits of other integration this provides

Basically to control your playback from many different contexts

overview
  • After Android-11 your media will be reflected on the notification bar as media control box.
  • It can display metadata and playback controls in the quick settings panel.
  • Users can control their media using wear-os using notification, voice-enabled commands using google assistant, etc.
  • Basically to control your playback from many different contexts.

Challenge involved in interaction

There were a lot of libraries involved

androidx-media2 com.google.android.exoplayer
media2-player media2-core
media2-widget media2-ui
media2-session media2-mediasession
media2-common media2-common
media2-dash
  • Observe there are 2-players, 2-widgets, 2-sessions, 2-common libraries.
  • Lot of duplicated code.
  • Each with limitations and advantages makes it difficult to know what to use when it comes to compatibility issues.

Solution to Challenge involved in interaction

androidx-media3
media3-exoplayer
media3-ui
media3-session
media3-common
media2-dash
  • As a result one cohesive block of libraries is provided to avoid confusion, compatibility, and a simpler approach.
⚠️ **GitHub.com Fallback** ⚠️