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

@umituz/react-native-media

v1.3.13

Published

Media picking capabilities for React Native apps - Images, videos from camera and gallery

Readme

@umituz/react-native-media

Version License TypeScript

Purpose

Advanced media management library for React Native applications. Provides media selection, upload, AI-powered generation, and flashcard multimedia support with Clean Architecture principles.

File Location

Project root: /README.md

Strategy

  • Provide comprehensive media handling for React Native applications
  • Support both general media operations and card-specific features
  • Enable AI-powered media generation (text-to-image, text-to-audio, image-search)
  • Maintain Clean Architecture with clear separation of concerns
  • Offer React Hooks for easy integration
  • Follow singleton pattern for services
  • Provide TypeScript types for type safety
  • Support Expo ecosystem (expo-image-picker, expo-media-library)

Forbidden

  • DO NOT use this library without proper permissions handling
  • DO NOT upload files without validation
  • DO NOT ignore file size limits
  • DO NOT use general media features for card-specific requirements
  • DO NOT mix card and general media types interchangeably
  • DO NOT bypass singleton pattern for services
  • DO NOT ignore error handling from services/hooks
  • DO NOT use deprecated APIs

Rules

  1. Always check permissions before accessing camera/gallery
  2. Always validate files before upload
  3. Always handle loading and error states
  4. Use hooks for React components, services for non-React code
  5. Follow position rules for card media (FRONT, BACK, BOTH)
  6. Respect file size limits (images: 10 MB, videos: 100 MB)
  7. Use appropriate quality levels for compression
  8. Handle all three generation types correctly (text_to_image, text_to_audio, image_search)
  9. Always check canceled flag in picker results
  10. Import from main entry point only

AI Agent Guidelines

Installation Requirements

Before using this library, ensure:

  • expo-image-picker (>=14.0.0) is installed
  • expo-media-library (>=15.0.0) is installed
  • Peer dependencies are met:
    • @umituz/react-native-design-system
    • @umituz/react-native-filesystem
    • @umituz/react-native-image
    • react (>=18.2.0)
    • react-native (>=0.74.0)

Feature Selection Guidelines

Use General Media Features When:

  • Building standard media handling features
  • No card/flashcard requirements exist
  • Basic upload/download/validation needed
  • General-purpose media operations

Use Card-Specific Features When:

  • Building flashcard applications
  • Position-based media needed (front/back/both)
  • Working with card entities
  • Need card-specific validation rules
  • Using card generation with +image-search

Permission Management

All media operations require proper permissions:

  • Camera access requires user permission
  • Gallery access requires user permission
  • Save to gallery requires write permission
  • Always handle permission denial gracefully
  • Provide clear UI for permission requests

Module Structure

Domain Layer

  • Location: src/domain/
  • Purpose: Core types and business logic
  • Contains: Media entities, enums, interfaces, utilities
  • Dependency: External library agnostic

Infrastructure Layer

  • Location: src/infrastructure/
  • Purpose: Service implementations and external integrations
  • Contains: Services for picker, upload, generation, validation, optimization
  • Dependency: Uses expo libraries and external APIs

Presentation Layer

  • Location: src/presentation/
  • Purpose: React hooks for UI integration
  • Contains: All use* hooks for React components
  • Dependency: Wraps infrastructure services

Service Pattern

All services follow singleton pattern:

  • Access via getInstance() method
  • Single instance throughout application
  • Static methods for direct access
  • Thread-safe operations

Hook Usage

Best practices for using hooks:

  • Use hooks in React components only
  • Follow naming convention (use*)
  • Handle loading states appropriately
  • Handle error states appropriately
  • Use progress callbacks when available
  • Destructure hook returns for clarity

Media Type Guidelines

General Media Types

  • MediaType.IMAGE - For images only
  • MediaType.VIDEO - For videos only
  • MediaType.ALL - For all media types

Card Media Positions

  • CardMediaPosition.FRONT - Media on card front
  • CardMediaPosition.BACK - Media on card back
  • CardMediaPosition.BOTH - Media on both sides

Generation Types

  • text_to_image - Generate images from text
  • text_to_audio - Generate audio from text
  • image_search - Search for images (card-specific only)

Validation Rules

File Size Limits

  • Images: Maximum 10 MB
  • Videos: Maximum 100 MB
  • Card media: Stricter limits apply

Supported Formats

  • Images: JPEG, PNG, WEBP, GIF
  • Videos: MP4, MOV
  • Audio: MP3, WAV, AAC

Quality Levels

  • LOW: 0.3 (30% quality)
  • MEDIUM: 0.7 (70% quality)
  • HIGH: 1.0 (100% quality)
  • ORIGINAL: No compression

Error Handling

Always handle these error scenarios:

  • Permission denied
  • File too large
  • Invalid format
  • Network timeout
  • Upload failure
  • Generation failure (insufficient credits)
  • Validation errors

Import Strategy

Import from main entry point only:

  • Services: Import by name
  • Hooks: Import by name
  • Types: Use import type for tree-shaking

Recommended patterns:

  • Import specific items you need
  • Avoid wildcard imports
  • Separate type imports
  • Use named exports only

Documentation Structure

For detailed information about specific features, refer to:

Domain Layer

Infrastructure Services

Infrastructure Utils

Presentation Hooks

Presentation Types

Contributing

Contributions are welcome! Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Ümit UZ

Acknowledgments

  • Expo team for expo-image-picker and expo-media-library
  • React Native community

Support

For issues and questions, please use GitHub Issues.

Related Projects