Skip to content

React Native Package

@ddgutierrezc/legato-react-native is the Expo Modules binding for Legato playback on iOS and Android.

This package line is documented with an explicit parity scope against @ddgutierrezc/legato-capacitor: same baseline exports, event constants, and sync semantics, with evidence-gated runtime claims.

Terminal window
npm install @ddgutierrezc/legato-react-native @ddgutierrezc/legato-contract

Add the Expo config plugin:

{
"expo": {
"plugins": ["@ddgutierrezc/legato-react-native"]
}
}

Generate and run native hosts:

Terminal window
npx expo prebuild --clean
npx expo run:ios
npx expo run:android
  • Same baseline exports (audioPlayer, mediaSession, Legato)
  • Same baseline event constants and listener helpers
  • Same sync startup semantics (start() snapshot + subscribe)
import { audioPlayer, mediaSession, Legato } from '@ddgutierrezc/legato-react-native';
import {
AUDIO_PLAYER_EVENTS,
MEDIA_SESSION_EVENTS,
LEGATO_EVENTS,
addAudioPlayerListener,
addMediaSessionListener,
addLegatoListener,
onPlaybackStateChanged,
onPlaybackActiveTrackChanged,
onPlaybackQueueChanged,
onPlaybackProgress,
onPlaybackEnded,
onPlaybackError,
onRemotePlay,
onRemotePause,
onRemoteNext,
onRemotePrevious,
onRemoteSeek,
createLegatoSync,
createAudioPlayerSync,
} from '@ddgutierrezc/legato-react-native';

Reference

reference/ API details for namespaces, events, sync, types, and plugin surface.

How-to

how-to/ Task-focused guides for Expo dev builds, event wiring, and sync usage.

Explanation

explanation/ Boundaries and responsibilities for host/runtime/parity decisions.

  • Plugin automation is prebuild-time native baseline wiring only.
  • Playback orchestration and lifecycle policy stay app-owned.
  • Parity claims are gated by source-backed evidence docs and tests.