react-native-picture-in-picture

PIP is a special type of multi-window mode mostly used for video playback. It lets the user watch a video in a small window pinned to a corner of the screen while navigating between apps or browsing content on the main screen.

Usage no npm install needed!

<script type="module">
  import reactNativePictureInPicture from 'https://cdn.skypack.dev/react-native-picture-in-picture';
</script>

README

react-native-picture-in-picture

//Under development, don't use it.

Getting started

$ npm install react-native-picture-in-picture --save

Android Setup

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"
    ...

IOS Setup

// TODO

Mostly automatic installation

$ react-native link react-native-picture-in-picture

Usage

import PictureInPicture from 'react-native-picture-in-picture';

function pipHandler(){
  PictureInPicture.start();
}