//Under development, don't use it.
$ npm install react-native-picture-in-picture --save
If you want support PIP in your app, register your video activity in your manifest by setting android:supportsPictureInPicture
and android:resizeableActivity
to true
. Edit your AndroidManifest.xml
:
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:resizeableActivity="true"
android:supportsPictureInPicture="true"
android:configChanges=
"screenSize|smallestScreenSize|screenLayout|orientation|keyboard|keyboardHidden"
...
// TODO
$ react-native link react-native-picture-in-picture
import PictureInPicture from 'react-native-picture-in-picture';
function pipHandler(){
PictureInPicture.start();
}