72.3 Entering Picture-in-Picture Mode
The enterPipMode onClick callback method now needs to be added to the MainActivity.java class file. Locate this file, open it in the code editor and add this method as follows:
.
.
import android.app.PictureInPictureParams;
import android.util.Rational;
.
.
public void enterPipMode(View view) {
Rational rational = new Rational(binding.videoView1.getWidth(),
binding.videoView1.getHeight());
PictureInPictureParams params =
new PictureInPictureParams.Builder()
.setAspectRatio(rational)
...