void updatePictureInPictureActions(
            @DrawableRes int iconId, String title, int controlType, int requestCode) {
        final ArrayList<RemoteAction> actions = new ArrayList<>();

        // This is the PendingIntent that is invoked when a user clicks on the action item.
        // You need to use distinct request codes for play and pause, or the PendingIntent won't
        // be properly updated.
        final PendingIntent intent =
                PendingIntent.getBroadcast(
                        AndroidOPiPActivity.this,
                        requestCode,
                        new Intent(ACTION_MEDIA_CONTROL).putExtra(EXTRA_CONTROL_TYPE, controlType),
                        0);
        final Icon icon = Icon.createWithResource(AndroidOPiPActivity.this, iconId);
        actions.add(new RemoteAction(icon, title, title, intent));

        mPictureInPictureParamsBuilder.setActions(actions);

        // This is how you can update action items (or aspect ratio) for Picture-in-Picture mode.
        // Note this call can happen even when the app is not in PiP mode. In that case, the
        // arguments will be used for at the next call of #enterPictureInPictureMode.
        setPictureInPictureParams(mPictureInPictureParamsBuilder.build());
    }
Update the state of pause/resume action item in Picture-in-Picture mode.

@param iconId      The icon to be used.
@param title       The title text.
@param controlType The type of the action. either {@link #CONTROL_TYPE_PLAY} or {@link
                   #CONTROL_TYPE_PAUSE}.
@param requestCode The request code for the {@link PendingIntent}.
dkplayer-sample/src/main/java/xyz/doikki/dkplayer/activity/pip/AndroidOPiPActivity.java