npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@videosdk.live/react-native-pip-android

v0.0.3

Published

Add picture in picture support to react native android application

Downloads

138

Readme

@videosdk.live/react-native-pip-android

Add picture in picture (PiP) support to React Native Android applications with full control over PiP mode and dimensions.

Features

  • Picture-in-Picture Mode Support - Enter PiP mode with custom dimensions
  • Auto PiP Control - Enable/disable automatic PiP mode entry
  • Custom Dimensions - Set custom width and height for PiP mode
  • Android 8.0+ Support - Full compatibility with modern Android versions

Installation

npm install @videosdk.live/react-native-pip-android
# or
yarn add @videosdk.live/react-native-pip-android

Setup

Android Manifest

Add the following to your android/app/src/main/AndroidManifest.xml:

<activity
  android:name=".MainActivity"
  android:supportsPictureInPicture="true"
  android:resizeableActivity="true"
  ... >

Usage

Basic PiP Mode

import PipHandler from '@videosdk.live/react-native-pip-android';

// Enter PiP mode with custom dimensions
PipHandler.enterPipMode(400, 300);

Control Auto PiP Mode

import PipHandler from '@videosdk.live/react-native-pip-android';

// Enable auto PiP mode (for meeting screens)
PipHandler.setMeetingScreenState(true);

// Disable auto PiP mode
PipHandler.setMeetingScreenState(false);

// Check current auto PiP state
const isEnabled = await PipHandler.getMeetingScreenState();

Set Custom Default Dimensions

import PipHandler from '@videosdk.live/react-native-pip-android';

// Set custom default dimensions
PipHandler.setDefaultPipDimensions(500, 400);

// Get current default dimensions
const dimensions = await PipHandler.getDefaultPipDimensions();
console.log(`Width: ${dimensions.width}, Height: ${dimensions.height}`);

PiP Mode Listener

import { usePipModeListener } from '@videosdk.live/react-native-pip-android';

function MyComponent() {
  const inPipMode = usePipModeListener();

  if (inPipMode) {
    return <Text>Currently in PiP Mode</Text>;
  }

  return <Text>Normal Mode</Text>;
}

API Reference

PipHandler Methods

| Method | Parameters | Returns | Description | |--------|------------|---------|-------------| | enterPipMode(width, height) | width: number, height: number | void | Enter PiP mode with custom dimensions | | setMeetingScreenState(value) | value: boolean | void | Enable/disable auto PiP mode | | getMeetingScreenState() | None | Promise<boolean> | Get current auto PiP mode state | | setDefaultPipDimensions(width, height) | width: number, height: number | void | Set custom default dimensions | | getDefaultPipDimensions() | None | Promise<{width: number, height: number}> | Get current default dimensions |

Hooks

| Hook | Returns | Description | |------|---------|-------------| | usePipModeListener() | boolean | Returns current PiP mode state |

Requirements

  • React Native 0.60+
  • Android 8.0+ (API level 26+)
  • AndroidX support

Permissions

The following permissions are automatically added:

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />