/** * Copyright (c) Double Symmetry GmbH * Commercial use requires a license. See https://rntp.dev/pricing */ import { WebTrackPlayer } from './web/WebTrackPlayer'; import type { Spec } from './NativeTrackPlayer'; // Web variant of the module seam. Resolved by the bundler's `.web` extension // in place of trackPlayerModule.ts. Uses a static ESM import (no `require`) // and routes events through the web module's EventBus instead of // NativeEventEmitter — so nothing here touches react-native's native bridge. // // `Spec` is a type-only import — erased at runtime, so the native TurboModule // stays out of the web bundle. The shim lives here (not a separate // NativeTrackPlayer.web.ts) so NativeTrackPlayer has no `.web` sibling to // self-shadow under platform-suffix resolution. const TrackPlayerWeb = new WebTrackPlayer() as unknown as Spec & { eventBus: WebTrackPlayer['eventBus']; }; export const TrackPlayer = TrackPlayerWeb; export const emitter = TrackPlayerWeb.eventBus;