Skip to content

Commit

Permalink
add back startForegroundService
Browse files Browse the repository at this point in the history
  • Loading branch information
jgitlin-nypr committed Sep 10, 2024
1 parent d4a65df commit 51a8947
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ public void connectAndInitialize(RemoteStreamerPlugin plugin, Intent intent) {
.setContentIntent(PendingIntent.getActivity(getApplicationContext(), 0, intent, PendingIntent.FLAG_IMMUTABLE))
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);

//startForeground(NOTIFICATION_ID, notificationBuilder.build(), ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
startForeground(NOTIFICATION_ID, notificationBuilder.build(), ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK);
} else {
startForeground(NOTIFICATION_ID, notificationBuilder.build());
}

notificationActions.put("play", new NotificationCompat.Action(
R.drawable.ic_baseline_play_arrow_24, "Play", MediaButtonReceiver.buildMediaButtonPendingIntent(this, (PlaybackStateCompat.ACTION_PLAY_PAUSE | PlaybackStateCompat.ACTION_PLAY))
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@nypublicradio/capacitor-remote-streamer",
"repository": "git://github.com/nypublicradio/capacitor-remote-streamer.git",
"version": "0.2.4",
"version": "0.2.5",
"description": "Stream remote HLS and MP3 streams on iOS and Android. Capacitor 6.",
"main": "dist/plugin.cjs.js",
"repository": {
Expand Down

0 comments on commit 51a8947

Please sign in to comment.