On an Android phone, a video can shrink into a small floating window and keep playing while the viewer uses another app. It looks like a single feature, but it is really a handful of small decisions: what the activity declares, how the app enters the window, what the window shows, how each player engine feeds it, and what the screen does while it is that small. Here is how Yonto Player's phone and tablet app makes each one, and why.
The activity declares support
Picture-in-picture is a mode of an activity, so the manifest is where it starts. A simplified outline of the flags that matter on the player's activity:
<!-- Simplified outline, not the real file. --> <activity android:name= ".MainActivity" android:supportsPictureInPicture= "true" android:configChanges= "orientation|screenSize|smallestScreenSize|screenLayout|density|..." android:launchMode= "singleTask" />
Enter fullscreen mode
Exit fullscreen mode
supportsPictureInPicture is the declaration itself.…