From 76b3ddcf6947c6327fbd8d19a509f4bff33a0717 Mon Sep 17 00:00:00 2001 From: dhk2 Date: Fri, 3 Jul 2020 15:47:20 -0700 Subject: [PATCH] adding controls to exit pip or switch to background audio --- .../net/schueller/peertube/activity/VideoPlayActivity.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java b/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java index 779afea..c890b91 100644 --- a/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java @@ -74,14 +74,16 @@ public class VideoPlayActivity extends AppCompatActivity { private static boolean floatMode = false; private static final int REQUEST_CODE = 101; private BroadcastReceiver receiver; + //This can only be called when in entering pip mode which can only happen on a high enough level to support pip mode. + @SuppressLint("NewApi") public void setActions(String actionCommand) { ArrayList actions = new ArrayList<>(); Intent actionIntent = new Intent(BACKGROUND_AUDIO); PendingIntent pendingIntent = PendingIntent.getBroadcast(getApplicationContext(), REQUEST_CODE, actionIntent, 0); - Icon icon = Icon.createWithResource(getApplicationContext(), android.R.drawable.stat_sys_speakerphone); - RemoteAction remoteAction = new RemoteAction(icon, "close pip", "from pip window custom command", pendingIntent); + @SuppressLint("NewApi") Icon icon = Icon.createWithResource(getApplicationContext(), android.R.drawable.stat_sys_speakerphone); + @SuppressLint("NewApi") RemoteAction remoteAction = new RemoteAction(icon, "close pip", "from pip window custom command", pendingIntent); actions.add(remoteAction); actionIntent = new Intent(ACTION_STOP);