Merge pull request #7568 from vhouriet/vhouriet_feature_already-playing-in-backgroud
Add Already playing in background toast
This commit is contained in:
commit
ee19ea66b3
2 changed files with 9 additions and 4 deletions
|
|
@ -168,10 +168,14 @@ public final class NavigationHelper {
|
|||
public static void playOnBackgroundPlayer(final Context context,
|
||||
final PlayQueue queue,
|
||||
final boolean resumePlayback) {
|
||||
if (PlayerHolder.getInstance().getType() != MainPlayer.PlayerType.AUDIO) {
|
||||
Toast.makeText(context, R.string.background_player_playing_toast, Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
}
|
||||
Toast.makeText(
|
||||
context,
|
||||
PlayerHolder.getInstance().getType() == PlayerType.AUDIO
|
||||
? R.string.background_player_already_playing_toast
|
||||
: R.string.background_player_playing_toast,
|
||||
Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
|
||||
final Intent intent = getPlayerIntent(context, MainPlayer.class, queue, resumePlayback);
|
||||
intent.putExtra(Player.PLAYER_TYPE, MainPlayer.PlayerType.AUDIO.ordinal());
|
||||
ContextCompat.startForegroundService(context, intent);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue