Last year, Android 7.0 introduced picture-in-picture (PiP) mode, making it possible to shrink a playing video down to a floating window that appears above all other content, allowing users to continue watching a video while taking care of another task. Unfortunately, at the time PiP mode was only available for Android TVs, so very few people ever got to take advantage of it.
That changed with Android O, which has brought PiP mode to Android devices with screens much smaller than a television's, including phones and tablets. However, since Android O is so new and few developers have had the time and resources to update their apps, it's hard to find any app that actually supports PiP for now. Luckily, the folks at XDA Developers have found a way to manually trigger PiP mode in any app, even if it hasn't yet been updated to work specifically with Android O.
The process is fairly simple and essentially just a question of mapping the correct key to the navigation bar through the method we covered a few days ago. In the video below, you can see that PiP works reasonably well for a YouTube video, although the video does encounter some resizing issues and a few bugs here and there during playback.
To manually enable PiP mode, all you need to do is go into the System UI Tuner, add a cursor button to the navigation bar and map it to keycode number 171, which triggers a KEYCODE_WINDOW event. Once that's done, pressing the little cursor on your navigation bar should toggle PiP mode as seen in the video.
The method is a bit of a hack for apps that technically still don't support PiP, so don't expect everything to work perfectly, but these little inconsistencies will likely get ironed out by the time Android O starts hitting phones later this year.
- XDA Developers