adding controls to exit pip or switch to background audio
This commit is contained in:
parent
71bc325d49
commit
76b3ddcf69
@ -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<RemoteAction> 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);
|
||||
|
Loading…
Reference in New Issue
Block a user