-
Couldn't load subscription status.
- Fork 84
Description
Describe the new feature you'd like
Pretty much as the title says: Add a non-interrupt option to disable anything that pause the streaming feature
Describe the reason why you want to add the feature
The app is awesome and I use it a lot. But sometimes the phone will automatically pause the background media when I take off my ear phones, and then the client will stay at pause state and never try to get back again even after I take on the ear phones and tap on the play button. Meanwhile, all the other music players works fine. So I need to pick up my phone, unlock, find the app and tap on the play button to make it work again. This seems to be a device specific bug, but for this it would be great if there is a "no pause" option to make the streaming won't be interrupted by any other operations.
Describe how to implement the feature if you can
I'm not familiar with Kotlin, but I guess this could be implemented by adding/removing the listener dynamically at:
Lines 105 to 118 in 342751f
| override fun onCustomCommand( | |
| session: MediaSession, | |
| controller: MediaSession.ControllerInfo, | |
| customCommand: SessionCommand, | |
| args: Bundle | |
| ): ListenableFuture<SessionResult> { | |
| if (customCommand.customAction == ACTION_STOP_SERVICE) { | |
| Log.d(tag, "ACTION_STOP_SERVICE") | |
| session.player.stop() | |
| stopSelf() | |
| return Futures.immediateFuture(SessionResult(SessionResult.RESULT_SUCCESS)) | |
| } | |
| return super.onCustomCommand(session, controller, customCommand, args) | |
| } |
Which seems to be listening to the media stop event. Also, the toggle button could be placed in the "Auto Start" section, under the "Auto start playback" option.
Additional context
None.