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 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-media-compositor

v1.0.2

Published

react-native-media-compositor is a react native package for compositing overlays into images and videos

Readme

react-native-media-compositor

react-native-media-compositor is a Nitro-based React Native module for burning styled text overlays into local images and videos.

Version Downloads License

What it supports today

  • Local file input and output on iOS and Android
  • Text overlay composition for images
  • Text overlay composition for videos
  • Preview-to-export crop parity via a preview size contract
  • Cancellation and basic processing status via the Nitro object

Current v1 limitations

  • Text overlays only
  • No remote URLs, asset-library URLs, or streaming inputs
  • No timed overlays or animation timeline yet
  • No custom fonts, image overlays, or sticker/video overlays yet

Installation

bun add react-native-media-compositor react-native-nitro-modules

Then regenerate native dependencies in your app as usual:

cd ios && pod install

API

The package exports:

  • composeImage(request)
  • composeVideo(request)
  • cancelComposition()
  • getMediaCompositor()

Important request types:

  • MediaCompositorTextOverlay
  • MediaCompositorNormalizedRect
  • MediaCompositorPreviewSpec

Why preview matters

If your UI displays media with resizeMode="cover", the user is looking at a cropped viewport, not the full source frame. Pass the measured preview size in the preview field so the native compositor can export the same crop the user saw in the editor.

If you omit preview, composition happens against the full source image/video frame.

Example

import { composeVideo } from 'react-native-media-compositor'

const result = await composeVideo({
  inputPath: 'file:///path/to/input.mp4',
  preserveAudio: true,
  preview: {
    width: 320,
    height: 568,
  },
  overlays: [
    {
      id: 'headline',
      text: 'Hello from Nitro',
      rect: {
        x: 0.1,
        y: 0.72,
        width: 0.8,
        height: 0.16,
      },
      style: {
        fontSize: 18,
        textColor: '#FFFFFF',
        backgroundColor: '#99000000',
        paddingHorizontal: 12,
        paddingVertical: 6,
        textAlign: 'center',
        opacity: 1,
        cornerRadius: 12,
      },
    },
  ],
})

console.log(result.filePath)

Running the example app

bun install
cd example
bun run pod
bun run ios
# or
bun run android

The example app lets you:

  • pick a local image or video
  • preview it with cover cropping
  • drag and edit a text overlay
  • export the result through the public package API

Development

bun run codegen
bun run build

Do not hand-edit files under nitrogen/generated.

Credits

Bootstrapped with create-nitro-module.