Add notification for empty player setting#2670
Conversation
|
Thanks for the idea. How would a notification for the empty player look like? It seems to me that basically all relevant and required information is missing at this point unless there is a custom |
In its most basic form, it looks like this: Indeed, rather useless/irrelevant on its own. The reason I am interested in it at the moment is stupid hacks, see #770 (comment). But that is not the only reason I want this. On my not-too-far-future roadmap, there's an item about more support for session-based cast protocols (it's not what I'm actually working with, but you can think of Miracast as example). Etablishing a connection takes considerable effort (confirmation on both devices) and time, hence it was decided a user should generally manually terminate a session (for example, by pressing the custom close command button in the media notification) instead of the app ending the session when there is no media currently set for whatever reason. To remind the user there still is casting session going on, there needs to be some sort of notification. Making the media notification disappear when playlist is empty just to show a casting session notification which isn't MediaStyle, which then disappears again and having a media notification come up when playlist stops being empty, is poor UX. Instead, the media notification should just signify that it is empty. This will be done with a ForwardingSimpleBasePlayer that modifies getMediaMetadata() to show a relevant message. (A custom MediaNotification.Provider is not necessary in this case.) For example: override fun getState(): State {
if (player.currentTimeline.isEmpty) {
val superState = super.state
return superState.buildUpon().setPlaylist(superState.timeline, superState.currentTracks,
MediaMetadata.Builder().setTitle("Nothing here...").build()).build()
}
return super.getState()
}The play button can also be added/removed as needed by changing available commands. |

No description provided.