You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Which plugins or players could give Cup's Android and iOS apps a media-playback foreground service and system controls under Capacitor 8? #372
Which plugins or players could give Cup's Android and iOS apps a mediaPlayback foreground service and system media controls under Capacitor 8, and what does each cost?
Compare at least:
@jofr/capacitor-media-session (WebView <audio> plus a foreground service)
Capawesome Media Session (controls for WebView playback)
An own Capacitor plugin around Media3's MediaSessionService with a SimpleBasePlayer that forwards commands to the WebView <audio> and receives its state from the page
Native players: Capawesome Audio Player or Capgo native-audio, and hand-written Media3 ExoPlayer plus AVPlayer
For each, report:
Capacitor 8 support and maintenance (last release, open issues)
The foreground-service type and permissions it declares (FOREGROUND_SERVICE_MEDIA_PLAYBACK)
Notification and lock-screen controls, including title, artwork, duration, position and seek
ACTION_AUDIO_BECOMING_NOISY and audio focus handling
What it needs from the web player, and for native players, what it means for ADR 0011, the shared web player, the signed track URL and the listening-position saves
Research doc: docs/research/capacitor-media-playback-options.md on branch research/capacitor-media-playback-options (not merged). Nothing was installed or run on a device; each claim is marked as read in source, from vendor or platform docs, or unverified.
WebView engine (keeps ADR 0011)
@jofr/capacitor-media-session 4.0.0: peer @capacitor/core ^6, last release and commit 2024-08-08, unanswered "abandonware?" issue, GPL-3.0. Source: mediaPlayback service started on playing/paused and stopped on none, but only FOREGROUND_SERVICE declared (no FOREGROUND_SERVICE_MEDIA_PLAYBACK, which Cup's target SDK 36 requires). No noisy or focus handling. Not viable as a dependency, useful only as a reference.
@capgo/capacitor-media-session 8.1.11 (2026-11-13, peer >=8, MPL-2.0, 0 open issues): same Android structure and gaps as jofr's (same manifest, no media-playback permission, no noisy or focus handling). Title, artwork, duration, position and seek all work. On iOS it writes MPNowPlayingInfoCenter natively, which may compete with WebKit's own Now Playing (unverified). Viable.
Capawesome Media Session 8.4.3: paid Insiders licence, private source. Its changelog mentions a media playback service, but the manifest and permissions can't be checked without buying, and noisy and focus handling aren't documented. The vendor itself recommends its native Audio Player when the web view is suspended. Viable only if paying is acceptable.
Own Capacitor plugin (Media3 MediaSessionService + a forwarding SimpleBasePlayer): the Media3 docs give the manifest (mediaPlayback, both permissions). Media3 runs the foreground service and the notification itself, and leaves the foreground after 10 minutes paused. Media-session notifications are exempt from POST_NOTIFICATIONS. SimpleBasePlayer has no audio focus handling (source), so Cup writes focus handling (unless WebView's own suffices, unverified) and a noisy receiver. iOS needs no native code. Viable.
With every WebView option, the page registers navigator.mediaSession handlers and position state (on Android, through the plugin). Headphone disconnects stay Cup's code: WebView doesn't handle ACTION_AUDIO_BECOMING_NOISY, and no plugin does.
Native engine (partly supersedes ADR 0011)
Capawesome Audio Player 8.5.1: paid, private source. Per its docs: Media3 MediaSessionService with both permissions declared by the app, metadata and seek offsets for audiobooks, audio focus on Android; noisy handling not documented. Viable if paying is acceptable.
@capgo/capacitor-native-audio 8.5.4 (2026-11-13, MPL-2.0): in source, there's no foreground service at all. It only posts a MediaStyle notification, and its README tells the app to start its own service. Controls are complete on both platforms. It requests transient focus, has no noisy handling, and background: true sets MODE_IN_COMMUNICATION. Weak: Cup would still write the service.
Hand-written ExoPlayer + AVPlayer: ExoPlayer handles focus and noisy through builder flags (source), and AVPlayer pauses on headphone disconnect (Apple docs). This is the most code. Cup ran this shape until 0fb4e71d. Viable.
Any native player adds a second engine behind the web player's timeline and PlaybackSession. The signed token URL works for native requests unchanged, and lock-screen Play after the token expires still fails. Position saves keep running in the page on Android while the service runs. On iOS, whether WebKit suspends a silent page in a backgrounded app is unverified; the removed coordinators saved positions natively.
Activity
patricktree commentedon Nov 14, 2026
Resolution
Research doc:
docs/research/capacitor-media-playback-options.mdon branchresearch/capacitor-media-playback-options(not merged). Nothing was installed or run on a device; each claim is marked as read in source, from vendor or platform docs, or unverified.WebView engine (keeps ADR 0011)
@jofr/capacitor-media-session4.0.0: peer@capacitor/core ^6, last release and commit 2024-08-08, unanswered "abandonware?" issue, GPL-3.0. Source:mediaPlaybackservice started onplaying/pausedand stopped onnone, but onlyFOREGROUND_SERVICEdeclared (noFOREGROUND_SERVICE_MEDIA_PLAYBACK, which Cup's target SDK 36 requires). No noisy or focus handling. Not viable as a dependency, useful only as a reference.@capgo/capacitor-media-session8.1.11 (2026-11-13, peer>=8, MPL-2.0, 0 open issues): same Android structure and gaps as jofr's (same manifest, no media-playback permission, no noisy or focus handling). Title, artwork, duration, position and seek all work. On iOS it writesMPNowPlayingInfoCenternatively, which may compete with WebKit's own Now Playing (unverified). Viable.MediaSessionService+ a forwardingSimpleBasePlayer): the Media3 docs give the manifest (mediaPlayback, both permissions). Media3 runs the foreground service and the notification itself, and leaves the foreground after 10 minutes paused. Media-session notifications are exempt fromPOST_NOTIFICATIONS.SimpleBasePlayerhas no audio focus handling (source), so Cup writes focus handling (unless WebView's own suffices, unverified) and a noisy receiver. iOS needs no native code. Viable.navigator.mediaSessionhandlers and position state (on Android, through the plugin). Headphone disconnects stay Cup's code: WebView doesn't handleACTION_AUDIO_BECOMING_NOISY, and no plugin does.Native engine (partly supersedes ADR 0011)
MediaSessionServicewith both permissions declared by the app, metadata and seek offsets for audiobooks, audio focus on Android; noisy handling not documented. Viable if paying is acceptable.@capgo/capacitor-native-audio8.5.4 (2026-11-13, MPL-2.0): in source, there's no foreground service at all. It only posts aMediaStylenotification, and its README tells the app to start its own service. Controls are complete on both platforms. It requests transient focus, has no noisy handling, andbackground: truesetsMODE_IN_COMMUNICATION. Weak: Cup would still write the service.0fb4e71d. Viable.PlaybackSession. The signedtokenURL works for native requests unchanged, and lock-screen Play after the token expires still fails. Position saves keep running in the page on Android while the service runs. On iOS, whether WebKit suspends a silent page in a backgrounded app is unverified; the removed coordinators saved positions natively.The engine choice is left to the grilling ticket.
docs: land the native Android media player map into the wiki (#371)
docs: land the native Android media player map into the wiki (#371) (#…