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-haptic-music-player-new

v1.0.6

Published

A fully fledged audio module created for music apps

Readme

react-native-haptic-music-player

A fully-fledged audio module created for music apps. Provides audio playback, external media controls, background mode and more!

downloads npm

Quick Start (Recommended)

For React Native 0.70+ and New Architecture compatibility, use the built-in simple player:

# No installation needed - uses built-in React Native components

Simple Haptic Player Usage

import React from 'react';
import { View } from 'react-native';
import PureRNHapticPlayer from './PureRNHapticPlayer'; // Copy from package

export default function App() {
  return (
    <View style={{ flex: 1 }}>
      <PureRNHapticPlayer />
    </View>
  );
}

Android Permission

Add to android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.VIBRATE" />

Customize Tracks

// In PureRNHapticPlayer.js, modify:
const tracks = [
  { title: 'Your Song 1', artist: 'Your Artist 1' },
  { title: 'Your Song 2', artist: 'Your Artist 2' },
];

Advanced Installation (Legacy)

For older React Native versions or advanced features:

npm install react-native-haptic-music-player-new

iOS Setup

cd ios && pod install

Android Setup

Auto-linking handles setup for RN 0.60+

Clean Build (If needed)

npx react-native start --reset-cache
cd ios && xcodebuild clean && pod install
cd android && ./gradlew clean
npx react-native run-android

Usage Examples

Basic Setup (Advanced)

import HapticPlayer from 'react-native-haptic-music-player-new';

const setupPlayer = async () => {
    try {
        await HapticPlayer.setupPlayer();
        await HapticPlayer.add({
            id: 'track1',
            url: 'https://example.com/song.mp3',
            title: 'Song Title',
            artist: 'Artist Name'
        });
        await HapticPlayer.play();
    } catch (error) {
        console.error('Setup failed:', error);
    }
};

React Hooks (Advanced)

import { useProgress, usePlaybackState } from 'react-native-haptic-music-player-new';

function Player() {
    const progress = useProgress();
    const playbackState = usePlaybackState();
    
    return (
        <View>
            <Text>{progress.position} / {progress.duration}</Text>
            <Text>State: {playbackState.state}</Text>
        </View>
    );
}

Features Comparison

| Feature | Simple Player | Advanced Package | |---------|---------------|------------------| | Haptic Feedback | ✅ | ✅ | | Play/Pause | ✅ | ✅ | | Track Navigation | ✅ | ✅ | | Progress Bar | ✅ | ✅ | | Background Play | ❌ | ✅ | | Media Controls | ❌ | ✅ | | Streaming | ❌ | ✅ | | Dependencies | None | Audio libraries | | RN 0.83+ Support | ✅ | ⚠️ |

Troubleshooting

"cannot read property HapticPlayerModule"

Solution: Use the Simple Player instead - it has no native dependencies.

Build Errors with New Architecture

Solution: Copy PureRNHapticPlayer.js and use built-in components.

Compatibility Issues

Solution: The Simple Player works with all React Native versions.

Recommendation

For new projects: Use PureRNHapticPlayer.js - it's dependency-free and works with all React Native versions including 0.83+ and New Architecture.

For existing projects: Migrate to the Simple Player to avoid compatibility issues.

Why Simple Player?

  • Zero Dependencies - No native modules to break
  • Always Compatible - Works with any React Native version
  • Haptic Feedback - Built-in vibration API
  • Modern UI - Spotify-inspired design
  • Easy Setup - Just copy and use

Maintainer

This package is maintained and developed by me as a personal project.