Skip to content

Capacitor Package

Use @ddgutierrezc/legato-capacitor when you need Capacitor runtime integration for audio playback on iOS and Android.

For package-line support and peer dependency compatibility, use the public Compatibility and Support Matrix.

A Capacitor plugin that exposes Legato playback APIs to web and hybrid JavaScript runtimes. It provides:

  • Audio player commands — play, pause, seek, queue management, and state queries.
  • Media session integration — remote control from lock screen, notification center, and Bluetooth controls.
  • Event subscriptions — typed listeners for playback lifecycle and remote commands.
  • Sync controllers — local snapshot mirroring for offline or UI-only display contexts.
  • Native maintainer CLIlegato native doctor/configure commands for repo-owned Capacitor groundwork checks.
ExportPurpose
audioPlayerPlayback commands, queue operations, read-model queries, and player events.
mediaSessionRemote control event listeners.
LegatoUnified facade combining audioPlayer and mediaSession surfaces with a single event listener. See Legato Facade.
import { audioPlayer, mediaSession, Legato } from '@ddgutierrezc/legato-capacitor';
import {
AUDIO_PLAYER_EVENTS,
MEDIA_SESSION_EVENTS,
LEGATO_EVENTS,
addAudioPlayerListener,
addMediaSessionListener,
addLegatoListener,
onPlaybackStateChanged,
onPlaybackActiveTrackChanged,
onPlaybackQueueChanged,
onPlaybackProgress,
onPlaybackEnded,
onPlaybackError,
onRemotePlay,
onRemotePause,
onRemoteNext,
onRemotePrevious,
onRemoteSeek,
} from '@ddgutierrezc/legato-capacitor';
import { createLegatoSync, createAudioPlayerSync } from '@ddgutierrezc/legato-capacitor';

This package is documented in three sections following Diátaxis methodology:

Overview

index.mdx What the package provides and how to get started.

Explanation

explanation/ Conceptual guidance for capabilities, snapshots, and runtime interpretation.

Reference

reference/ Detailed API reference for every exported method, type, and event.

How-to

how-to/ Task-oriented guides for common integration patterns.

Start with Capability Projection and Snapshot Semantics for the mental model, then apply it in Build Capability-Driven Controls and Send Secure Track Headers. Use Native CLI when working on repository-native setup checks.