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

react-native-frame-capture

v1.0.1

Published

Reliable screen capture for React Native Android. Capture frames at intervals with customizable overlays and storage options.

Readme

React Native Frame Capture

npm version npm downloads license platform

Reliable screen capture for React Native Android. Capture frames at intervals with customizable overlays and storage options.

Features

  • 📸 Interval-based capture - Capture frames at configurable intervals (100ms - 60s)
  • 🎨 Customizable overlays - Add text and image overlays with template variables
  • 💾 Flexible storage - Save to app-specific, public, or custom directories
  • 🔄 Background capture - Continues capturing when app is minimized (foreground service)
  • High performance - Built with Kotlin and TurboModule architecture
  • 🎯 Precise control - Pause, resume, and stop capture on demand
  • 📊 Real-time events - Get notified for every captured frame
  • 🔧 Highly configurable - Image quality, format, resolution scaling, and more
  • 📱 Expo compatible - Works with Expo through config plugin
  • 🎭 Custom regions - Capture specific screen areas
  • 🚫 Status bar exclusion - Optionally exclude status bar from captures

How It Works

React Native Frame Capture uses Android's MediaProjection API to capture screen content at regular intervals. Here's the flow:

  1. Request Permission - User grants screen capture permission via system dialog
  2. Start Foreground Service - Ensures capture continues in background
  3. Create Virtual Display - Mirrors screen content to an ImageReader
  4. Capture Frames - Grabs frames at your specified interval (e.g., every 1 second)
  5. Process & Save - Converts to bitmap, applies overlays, saves to storage
  6. Emit Events - Notifies your app with frame info (path, size, timestamp)

Key Components:

  • MediaProjection - Android API for screen capture (no root required)
  • Foreground Service - Keeps capture running when app is minimized
  • ImageReader - Efficiently captures screen pixels
  • TurboModule - Fast native-to-JS communication

Why Foreground Service? Android kills background processes aggressively. The foreground service (with notification) ensures reliable capture even when your app isn't visible.

Requirements

  • React Native >= 0.74
  • Android minSdkVersion >= 21 (Android 5.0)
  • Android compileSdkVersion >= 34

Installation

npm install react-native-frame-capture

or

yarn add react-native-frame-capture

Expo

Add the config plugin to your app.json or app.config.js:

{
  "expo": {
    "plugins": ["react-native-frame-capture"]
  }
}

Then rebuild your app:

npx expo prebuild
npx expo run:android

Quick Start

import * as FrameCapture from 'react-native-frame-capture';
import { Platform, PermissionsAndroid } from 'react-native';

// 1. Request notification permission (Android 13+)
if (Platform.OS === 'android' && Platform.Version >= 33) {
  await PermissionsAndroid.request(
    PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS
  );
}

// 2. Request screen capture permission
const permissionStatus = await FrameCapture.requestPermission();

if (permissionStatus === FrameCapture.PermissionStatus.GRANTED) {
  // 3. Start capturing
  await FrameCapture.startCapture({
    capture: {
      interval: 1000, // Capture every second
    },
    image: {
      quality: 80,
      format: 'jpeg',
    },
    storage: {
      saveFrames: true,
      location: 'private',
    },
  });

  // 4. Listen for captured frames
  const subscription = FrameCapture.addListener(
    FrameCapture.CaptureEventType.FRAME_CAPTURED,
    (event) => {
      console.log('Frame captured:', event.filePath);
    }
  );

  // 5. Stop capturing when done
  await FrameCapture.stopCapture();
  subscription.remove();
}

Documentation

Platform Support

| Platform | Supported | Version | | -------- | --------- | ------- | | Android | ✅ Yes | 5.0+ | | iOS | ❌ No | N/A |

Architecture

  • TurboModule: New Architecture compatible
  • Foreground Service: Reliable background capture
  • Kotlin: Native Android implementation
  • TypeScript: Type-safe JavaScript API

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT © Nasyx Rakeeb

Made with ❤️ using create-react-native-library