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
Make AudioBecomingNoisyManager, WakeLockManager, and AudioFocusManager public #1893
When implementing a player that is not based on exoplayer, we need to handle becoming noisy, audio focus, and the wake management ourselves. Exoplayer has implementations for all these that I believe I could use in my player, but they are package private.
Proposed solution
Make AudioBecomingNoisyManager, WakeLockManager, and AudioFocusManager public. Or make a variant of SimpleBasePlayer that handles them.
Alternatives considered
my current solution is to copy these classes.
Reacted by NikSatyr, Uli Bubenheimer and Nguyen Manh Tuan
Make AudioBecomingNoisyManager, WakeLockManager, and AudioFocusManager public
I assume that since you want to use these with a non-ExoPlayer player you'd want them in an artifact like androidx.media3:media3-common, rather than media3-exoplayer.
Yes, in the app I'm working I use exoplayer for audiobooks, and TTS Voices for reading text for non-audio books. So I use a custom player for TTS Voices.
For the Custom player for playing the TTS Voices, I made copies of AudioBecomingNoisyManager, WakeLockManager, and AudioFocusManager for my custom player. But there's kind of maintenance nightmare.
@johngray1965 could i have a look at your player class? i currently want to implement the simple base player and somehow i have an issue with media button receiver. i want to know what did i do wrong with my player...
Sorry, the app I'm working on is closed source. So I can't share the code. I can tell you bit about it. I ended just having a single player (otherwise it caused issues when I moved from one document to another if they needed a different player). So I created one derived from SimpleBasePlayer. I have two ItemPlayers (one that use exoplayer, and one that uses TTS voices). The common player does all common things (managing playlists, etc...). The ItemPlayers just know how to play a single item and general play control things for a single item (play, plause, jump forward, jump back, etc..). And they report their position back to the real player. If you want to share you code, I'll tell you if I see what's wrong.
Activity
icbaker commentedon Nov 21, 2024
I assume that since you want to use these with a non-ExoPlayer player you'd want them in an artifact like
androidx.media3:media3-common, rather thanmedia3-exoplayer.I will discuss this proposal with the team.
johngray1965 commentedon Nov 21, 2024
Yes, in the app I'm working I use exoplayer for audiobooks, and TTS Voices for reading text for non-audio books. So I use a custom player for TTS Voices.
kuro-mujou commentedon Feb 21, 2025
@johngray1965 sir, do you have any idea for the custom player for TTS?
johngray1965 commentedon Feb 21, 2025
For the Custom player for playing the TTS Voices, I made copies of AudioBecomingNoisyManager, WakeLockManager, and AudioFocusManager for my custom player. But there's kind of maintenance nightmare.
kuro-mujou commentedon Feb 21, 2025
@johngray1965 could i have a look at your player class? i currently want to implement the simple base player and somehow i have an issue with media button receiver. i want to know what did i do wrong with my player...
johngray1965 commentedon Feb 21, 2025
Sorry, the app I'm working on is closed source. So I can't share the code. I can tell you bit about it. I ended just having a single player (otherwise it caused issues when I moved from one document to another if they needed a different player). So I created one derived from SimpleBasePlayer. I have two ItemPlayers (one that use exoplayer, and one that uses TTS voices). The common player does all common things (managing playlists, etc...). The ItemPlayers just know how to play a single item and general play control things for a single item (play, plause, jump forward, jump back, etc..). And they report their position back to the real player. If you want to share you code, I'll tell you if I see what's wrong.
Make player utility classes public
tonihei commentedon Oct 13, 2025
These classes are now public (will be released with version 1.9.0)
Make player utility classes public
Make player utility classes public