react-native-android-pip

React Native Android Pip Module

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
react-native-android-pip
1.0.15 years ago5 years agoMinified + gzip package size for react-native-android-pip in KB

Readme

react-native-android-pip

Getting started

Ensure that Android SDK > 24 and include in your AndroidManifest.xml activity:
`android:resizeableActivity="true" android:supportsPictureInPicture="true" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|smallestScreenSize|orientation"`
$ npm install react-native-android-pip --save

Mostly automatic installation

$ react-native link react-native-android-pip

Manual installation

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
- Add import com.reactlibrary.RNAndroidPipPackage; to the imports at the top of the file - Add new RNAndroidPipPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
``` include ':react-native-android-pip' project(':react-native-android-pip').projectDir = new File(rootProject.projectDir, '../nodemodules/react-native-android-pip/android') `` 3. Insert the following lines inside the dependencies block in android/app/build.gradle`: ```
compile project(':react-native-android-pip')
```

Usage

import AndroidPip from 'react-native-android-pip';

AndroidPip.enterPictureInPictureMode()