/** * As soon as somebody starts this service as background player, we create the * player notification. When created this notification will move the service to * foreground to avoid being destroyed by the system. */ private void handleStartInBackground() { isPlaybackInBackground = true; playerNotificationManager = new PlayerNotificationManager(this, NotificationHelper.BACKGROUND_PLAYBACK_CHANNEL_ID, NotificationHelper.BACKGROUND_PLAYBACK_NOTIFICATION_ID, this); playerNotificationManager.setOngoing(false); playerNotificationManager.setPlayer(player.getExoPlayer()); playerNotificationManager.setNotificationListener(this); playerNotificationManager.setSmallIcon(R.drawable.ic_zapp_tv); playerNotificationManager.setColor(getResources().getColor(R.color.colorPrimaryDark)); playerNotificationManager.setMediaSessionToken(player.getMediaSession().getSessionToken()); }
playerNotificationManager.setNotificationListener( new PlayerNotificationManager.NotificationListener() { @Override