Android App Development
iOS App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 220.127.116.11 release ready!
Owner and Founder. Opencart
Picture In Picture is a new feature introduced in the Android 8.0 (API level 26). It is a multi-window mode which is mostly used for video playback. A small screen starts to float in the device screen and the user can do other work while watching the small screen. This screen appears on the topmost layer and the user can drag it to any corner they want. You can check the Google Developers Docs for details
1) Activities do not support PIP mode by default. To make them support this feature we need to add a few attributes in the activity tag in your AndroidManifest.
So, after adding these your activity tag will look something like this.
2) To start the PIP mode you need to call enterPictureInPictureMode() function according to your need. Either you can call it when the user hits the home button that means in onPause() or when the user presses the back button.
To define the dimensions of the small screen, you need to pass a Rational object to the function.
3) As the application enters or exits the PIP mode, onPictureInPictureModeChanged() function is called. You can make the changes in the UI according to the screens.
4) This is how the PIP mode will look like.
You can use this to show videos on a small screen or you can also use it to show navigation. Make sure you have less number of UI components when in PIP mode.
That’s all for this blog. Thank you very much. This is Vedesh Kumar signing off.
Your email address will not be published. Required fields are marked*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
Webkul is a truly trusted and supported IT Company to develop business ideas for e-commerce. They provide professional support after deploying the solution to production and be responsible to act for fixing the reported issues or system errors. We highly encourage to deal with Webkul for business development.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.