Background Audio + Lock Screen Controls for Android
Lumin Plugins
$15.39
$21.99
30%OFF
(no ratings)
Jump AssetStore
Keep audio playing through screen lock on Android with full notification and lock-screen media controls (play, pause, stop). Powered by ExoPlayer and MediaSession.This plugin contains no rendering or shader code — it works with any render pipeline. Android only (API 21+). Requires AndroidX enabled in Gradle properties and ExoPlayer dependencies in mainTemplate.gradle (included setup guide covers this in 2 minutes).The ProblemUnity's AudioSource goes silent the moment your Android user locks their screen or switches apps. If you're building a meditation app, music player, podcast app, audiobook reader, or any audio-focused experience, this is a dealbreaker.The SolutionBackground Audio for Android runs a proper Android foreground service using ExoPlayer and MediaSession — the same technology stack that powers Spotify, YouTube Music, and Google Podcasts. Your audio keeps playing through screen lock, app switching, and even headset removal, with full media controls in the notification shade and on the lock screen.What You Get• A compiled Android library (AAR) containing the background audio service• A clean C# bridge class with a simple static API• A progress callback receiver for real-time UI updates• Two example scenes demonstrating basic and advanced usage• Complete documentation with a step-by-step setup guideSimple APIStarting background audio is a single method call:AndroidBackgroundAudio.StartBackground(url, "Track Title", "Artist");Control playback from anywhere:AndroidBackgroundAudio.Play();AndroidBackgroundAudio.Pause();AndroidBackgroundAudio.Seek(positionMs);AndroidBackgroundAudio.Stop();Requirements• Unity 2020.3 LTS or newer• Android API 21+ (Android 5.0 Lollipop)• AndroidX enabled• Lock screen & notification media controls (play, pause, stop)• Stream audio from any HTTPS URL or play local files• ExoPlayer handles buffering, codecs, and audio focus automatically• MediaSession integration works with Bluetooth, car systems, and wearables• Automatic pause when headphones are unplugged• Real-time progress callbacks (~2Hz) to your C# code• Proper foreground service — won't be killed by the OS• Works alongside Unity's AudioSource for sound effects and UI audio• No-op on non-Android platforms — no #if guards needed in your code• Android API 21–34 tested• Includes ProGuard/R8 consumer rules for minified buildsClaude (Anthropic) was used as a coding assistant during development — helping write and debug the Java service code, C# bridge scripts, Gradle build configuration, documentation, and Asset Store listing copy. All code was reviewed, tested on physical devices, and validated by the developer. No AI-generated audio, visual, or 3D assets are included in the package.




