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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-nitro-media-kit

v0.0.1

Published

A React Native module for advanced media processing using Nitro Modules.

Readme

React Native Nitro Media Kit

npm version
npm downloads
License

🎥 React Native Nitro Media Kit empowers your React Native applications with robust media processing capabilities. Perform tasks like merging videos and converting images into videos with ease, all while leveraging the power of Nitro Modules.


🚀 Features

  • 🎨 Convert Image to Video: Turn your static images into dynamic videos.
  • 🎬 Merge Videos: Combine multiple videos seamlessly into one.
  • ⚡ Fast and Efficient: Optimized for high performance with Nitro Modules.
  • 📱 Cross-Platform: Fully supports both Android and iOS.

🛠️ Prerequisites

Before getting started, ensure you have the following:


📦 Installation

Run the following command to install the package and its dependencies:

npm install react-native-nitro-media-kit react-native-nitro-modules

For iOS, install pods:

cd ios && pod install

📘 API Reference

🎨 convertImageToVideo

Converts an image into a video with a specified duration.

📋 Parameters:

  • imagePathOrUrl (string): Local path or URL of the image.
  • duration (number): Duration of the video in seconds.

🛠️ Returns:

  • A promise that resolves with the local path to the created video.

🎬 mergeVideos

Merges multiple videos into one.

📋 Parameters:

  • videoPathsOrUrls (string[]): Array of local paths or URLs of the videos.

🛠️ Returns:

  • A promise that resolves with the local path to the merged video.

📝 Examples

🎨 Convert Image to Video

import { mediakit } from 'react-native-nitro-media-kit';

const handleConvertImageToVideo = async () => {
  try {
    const video = await mediakit.convertImageToVideo(
      'https://unsplash.com/photos/b9-odQi5oDo/download?ixid=M3wxMjA3fDB8MXxzZWFyY2h8Mnx8dXJsfGVufDB8fHx8MTczMjM0MTM2NXww&force=true&w=1920',
      5
    );
    console.log('Video created at:', video);
  } catch (error) {
    console.error('Error converting image to video:', error);
  }
};

🎬 Merge Videos

import { mediakit } from 'react-native-nitro-media-kit';

const handleMergeVideos = async () => {
  try {
    const video = await mediakit.mergeVideos([
      'https://www.sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4',
      'https://www.sample-videos.com/video321/mp4/720/big_buck_bunny_720p_2mb.mp4',
      'https://www.sample-videos.com/video321/mp4/720/big_buck_bunny_720p_2mb.mp4',
    ]);
    console.log('Merged video saved at:', video);
  } catch (error) {
    console.error('Error merging videos:', error);
  }
};

❤️ Support the Project

If you find this package useful, consider sponsoring me to support ongoing development and maintenance. Every contribution, big or small, helps keep this project alive and thriving! 🌟

Sponsor


🗂️ Project Structure

├── android/
│   ├── src/main/java/com/yourpackagename/nitromediakit/
│   └── build.gradle
├── ios/
│   ├── NitroMediaKit.swift
│   └── NitroMediaKit.podspec
├── src/
│   ├── index.ts
│   └── specs/
├── cpp/
├── nitrogen/
├── nitro.json
└── package.json

🤝 Contributing

We ❤️ contributions! If you'd like to improve this package, open an issue or create a pull request. Let's build this together! 🚀


📜 License

This project is licensed under the MIT License.


Happy coding! 🚀🎉