/** * Copyright (c) Double Symmetry GmbH * Commercial use requires a license. See https://rntp.dev/pricing */ import type { PlayerCommand, RemoteControlHandling, PerCommandHandling } from './PlayerCommand'; export interface PreloadConfig { /** * Auto-preload next N tracks in queue. Preloading starts when the current * item is live, a local file, or fully cached on disk. It also re-evaluates * when the queue changes (items added, removed, replaced, or reordered). * @default 0 (disabled) */ window?: number; } export interface PreloadOptions { /** * Target duration in seconds. If omitted, preloads the entire file. */ duration?: number; } export interface CacheConfig { /** * Maximum disk cache size in bytes. * When the cache exceeds this size, least-recently-used items are evicted. * @default 524288000 (500 MB) */ maxSizeBytes?: number; /** * Preloading configuration. Requires cache to be enabled. */ preloading?: PreloadConfig; } export declare const DEFAULT_CACHE_CONFIG: Required>; /** * Use this as the `cast` receiver app ID to enable Chromecast with Google's * Default Media Receiver — no custom receiver registration required. */ export declare const DEFAULT_CAST_RECEIVER_APP_ID = "CC1AD845"; /** Defaults for Android-specific config. */ export type TaskRemovedBehavior = 'continue' | 'stop'; export declare const DEFAULT_ANDROID_PLAYER_CONFIG: AndroidPlayerConfig; export interface AndroidPlayerConfig { /** @default 'none' */ wakeMode: 'none' | 'local' | 'network'; /** @default false */ skipSilenceEnabled: boolean; /** * When the app is removed from recents: `continue` keeps playback; `stop` tears down the service. * * @platform android * @default 'continue' * @since 5.4.0 */ taskRemovedBehavior?: TaskRemovedBehavior; /** * Android notification configuration. */ notification?: { channelId: string; channelName: string; smallIcon: string; }; /** * Chromecast receiver app ID. When set, Cast support is enabled and the * `` / `` will filter for this receiver. * Use `DEFAULT_CAST_RECEIVER_APP_ID` for Google's Default Media Receiver * (no registration required). Omit to disable Cast entirely. */ cast?: string; } /** Defaults for top-level player config. TS is the source of truth. */ export declare const DEFAULT_PLAYER_CONFIG: Required> & { android: AndroidPlayerConfig; }; /** * Remote control and media-session command configuration (lock screen, notification, * Android Auto, and similar surfaces). * * @remarks * This configures **native** behavior. With `handling: 'native'` (default), actions * run without JavaScript; on Android, config is persisted for the playback service. * `handling: 'js'` / `'hybrid'` emit events to `addEventListener` / * `registerBackgroundEventHandler` on the phone only — Android Auto and CarPlay do not * run the React Native JS runtime for transport controls; use native handling or * native extensions for in-car custom behavior. */ export interface RemoteControlConfig { /** * Which commands are available in the notification/remote controls and media session. */ capabilities: PlayerCommand[]; /** * Who handles remote control button presses. * @default 'native' */ handling?: RemoteControlHandling; /** * Per-command handling overrides (only used when handling is 'hybrid'). */ perCommandHandling?: PerCommandHandling; /** * Interval in seconds for the skip-forward button (default: 15). * Only used when capabilities includes SkipForward and handling is native or hybrid native for that command. */ forwardInterval?: number; /** * Interval in seconds for the skip-backward button (default: 15). * Only used when capabilities includes SkipBackward and handling is native or hybrid native for that command. */ backwardInterval?: number; } export interface ProgressSyncConfig { intervalSeconds?: number; http?: { url: string; headers?: Record; }; } export interface PlayerConfig { /** * Content type hint for the system. Affects audio routing and focus behavior. * - 'music': Standard music playback (default) * - 'speech': Spoken content like podcasts/audiobooks * * On iOS this sets the AVAudioSession mode (.default vs .spokenAudio). * On Android this sets AudioAttributes contentType (MUSIC vs SPEECH). */ contentType?: 'music' | 'speech'; /** * Whether the player should automatically pause when audio output is rerouted * (e.g. headphones disconnected). Defaults to true. */ handleAudioBecomingNoisy?: boolean; /** * When `true` (default), ICY/ID3 metadata updates the queued MediaItem and Now Playing. * When `false`, only {@link Event.MetadataReceived} is emitted; call {@link updateMetadata} yourself. * * @default true * @since 5.1.0 */ autoUpdateMetadataFromStream?: boolean; /** * How this player's audio coexists with other apps' audio. * - 'exclusive' (default): interrupts other apps' audio. * - 'mix': plays layered over other apps without interrupting them. * * On iOS this toggles the AVAudioSession `.mixWithOthers` category option. * On Android 'mix' holds no audio focus, so the player won't auto-pause for * calls or resume afterwards. * * @default 'exclusive' * @since 5.5.0 */ audioMixing?: 'exclusive' | 'mix'; /** * Enable disk caching and preloading. * * When set, played audio is written through to a disk cache and the next * queue item is automatically preloaded. Previously cached content is served * from disk on subsequent plays. * * On Android this uses Media3's SimpleCache + CacheDataSource. * On iOS this uses an AVAssetResourceLoaderDelegate-based streaming cache. */ cache?: CacheConfig; progressSync?: ProgressSyncConfig; android?: Partial; } //# sourceMappingURL=PlayerConfig.d.ts.map