Socket
Book a DemoInstallSign in
Socket

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

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Add picture in picture support to react native android application

0.0.3
latest
npmnpm
Version published
Maintainers
2
Created
Source

@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

MethodParametersReturnsDescription
enterPipMode(width, height)width: number, height: numbervoidEnter PiP mode with custom dimensions
setMeetingScreenState(value)value: booleanvoidEnable/disable auto PiP mode
getMeetingScreenState()NonePromise<boolean>Get current auto PiP mode state
setDefaultPipDimensions(width, height)width: number, height: numbervoidSet custom default dimensions
getDefaultPipDimensions()NonePromise<{width: number, height: number}>Get current default dimensions

Hooks

HookReturnsDescription
usePipModeListener()booleanReturns 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" />

Keywords

react-native

FAQs

Package last updated on 25 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.