@simba-dev/react-native-media-player 1.0.8 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,174 @@
1
+ import {useCallback} from 'react';
2
+ import {useOpenWithResume} from './useOpenWithResume';
3
+
4
+ /**
5
+ * V14 Phase 60: the deep-link helper hook.
6
+ *
7
+ * Apps that handle "open with" / Android Share Sheet / cold-start
8
+ * deep links all converge on the same boilerplate:
9
+ *
10
+ * 1. Listen for `Linking.addEventListener('url', ...)`.
11
+ * 2. On cold start, also call `Linking.getInitialURL()`.
12
+ * 3. Filter for the URI schemes the app handles (typically
13
+ * `content://` and `file://` for shared media files).
14
+ * 4. Derive a display title from the URI basename.
15
+ * 5. Classify the file as audio or video (typically by extension).
16
+ * 6. Forward to the player via `openPlayer({uri, title, type, ...})`.
17
+ *
18
+ * Before V14, every consumer wrote this glue themselves. The shape
19
+ * was always the same; only the title-derivation heuristic and
20
+ * the extension lists varied.
21
+ *
22
+ * `useOpenFromUrl` absorbs steps 3–6. The consumer still owns step
23
+ * 1 + 2 (the `Linking` plumbing), but those are 4 lines of React
24
+ * boilerplate that any RN dev can write. The type-classification
25
+ * + title-derivation + openPlayer forwarding is the actual glue.
26
+ *
27
+ * @example
28
+ * ```tsx
29
+ * const openFromUrl = useOpenFromUrl();
30
+ *
31
+ * useEffect(() => {
32
+ * Linking.getInitialURL().then(url => url && openFromUrl(url));
33
+ * const sub = Linking.addEventListener('url', ({url}) => openFromUrl(url));
34
+ * return () => sub.remove();
35
+ * }, [openFromUrl]);
36
+ * ```
37
+ */
38
+
39
+ /**
40
+ * Audio file extensions (lowercase, no dot). Conservative list —
41
+ * any consumer with a custom format can pass a `classifyType` prop
42
+ * (TODO if needed; not in V14 spec).
43
+ */
44
+ const AUDIO_EXTENSIONS = new Set([
45
+ 'mp3',
46
+ 'm4a',
47
+ 'm4b',
48
+ 'aac',
49
+ 'flac',
50
+ 'ogg',
51
+ 'opus',
52
+ 'wav',
53
+ 'wma',
54
+ 'aiff',
55
+ 'alac',
56
+ 'mp2',
57
+ 'amr',
58
+ 'ac3',
59
+ 'oga',
60
+ ]);
61
+
62
+ /**
63
+ * Video file extensions (lowercase, no dot). Same conservatism
64
+ * as `AUDIO_EXTENSIONS`.
65
+ */
66
+ const VIDEO_EXTENSIONS = new Set([
67
+ 'mp4',
68
+ 'm4v',
69
+ 'mkv',
70
+ 'webm',
71
+ 'avi',
72
+ 'mov',
73
+ 'wmv',
74
+ 'flv',
75
+ 'ts',
76
+ 'm2ts',
77
+ 'mpg',
78
+ 'mpeg',
79
+ 'vob',
80
+ 'ogv',
81
+ '3gp',
82
+ '3g2',
83
+ 'f4v',
84
+ 'mp2p',
85
+ ]);
86
+
87
+ /**
88
+ * Pull the extension off a URI basename. Strips any query string
89
+ * or fragment first (so `foo.MP3?token=abc` returns `mp3`). Returns
90
+ * an empty string if the basename has no extension.
91
+ */
92
+ function getExtension(uri: string): string {
93
+ const clean = uri.split('?')[0].split('#')[0];
94
+ // Take the last path segment. Use both / and \\ separators so
95
+ // file:// URIs from Windows-style paths still work.
96
+ const basename = clean.split(/[/\\]/).pop() || '';
97
+ const dot = basename.lastIndexOf('.');
98
+ return dot >= 0 ? basename.slice(dot + 1).toLowerCase() : '';
99
+ }
100
+
101
+ /**
102
+ * Classify a media URI as 'audio' or 'video' by file extension.
103
+ * Unknown extensions default to 'video' — matches the SIMBA
104
+ * consumer's pre-V14 convention. (The video default is permissive:
105
+ * if we guess wrong, the player handles both via mpv. Defaulting
106
+ * to audio would silently hide the surface for a video file.)
107
+ */
108
+ function classifyMediaType(uri: string): 'audio' | 'video' {
109
+ const ext = getExtension(uri);
110
+ if (VIDEO_EXTENSIONS.has(ext)) return 'video';
111
+ if (AUDIO_EXTENSIONS.has(ext)) return 'audio';
112
+ return 'video';
113
+ }
114
+
115
+ /**
116
+ * Derive a human-readable display name from a URI. Strips the
117
+ * file extension, URL-decodes the basename, and falls back to
118
+ * 'Shared File' if the URI has no usable path component.
119
+ */
120
+ function deriveDisplayName(uri: string): string {
121
+ const clean = uri.split('?')[0].split('#')[0];
122
+ const fileName = clean.split('/').pop() || 'Shared File';
123
+ const noExt = fileName.replace(/\.[^.]+$/, '');
124
+ try {
125
+ return decodeURIComponent(noExt) || 'Shared File';
126
+ } catch {
127
+ // Malformed URI — fall back to the raw basename.
128
+ return noExt || 'Shared File';
129
+ }
130
+ }
131
+
132
+ /**
133
+ * V14 Phase 60: the deep-link helper hook.
134
+ *
135
+ * Returns a stable callback that takes a URI string and, if the
136
+ * URI looks like a sharable media file (`content://` or `file://`),
137
+ * opens it in the player with a derived title + classified type.
138
+ * Returns `false` for URIs the hook ignores (empty / wrong scheme).
139
+ *
140
+ * The returned callback composes with the nearest
141
+ * `<PlayerResumeProvider>` (set up by `<SimbaPlayer>` in the
142
+ * consumer's App root): the URI is passed as `resumeId` so the
143
+ * consumer's bookmark lookup runs. If the URI has a saved
144
+ * bookmark, playback resumes from that position; otherwise the
145
+ * file plays from the start.
146
+ */
147
+ export function useOpenFromUrl(): (uri: string) => Promise<boolean> {
148
+ const openPlayer = useOpenWithResume();
149
+ return useCallback(
150
+ async (uri: string): Promise<boolean> => {
151
+ // Defensive: empty / non-sharable URIs are no-ops.
152
+ if (!uri) return false;
153
+ if (!uri.startsWith('content://') && !uri.startsWith('file://')) {
154
+ return false;
155
+ }
156
+
157
+ const title = deriveDisplayName(uri);
158
+ const type = classifyMediaType(uri);
159
+
160
+ // Pass the URI as `resumeId` so the consumer's bookmark
161
+ // lookup runs. Shared content:// URIs are not in the
162
+ // bookmark slice, so the lookup typically returns 0 (start
163
+ // from the beginning). But if the user previously saved a
164
+ // bookmark for the same URI, playback resumes from there.
165
+ return openPlayer({
166
+ uri,
167
+ title,
168
+ type,
169
+ resumeId: uri,
170
+ });
171
+ },
172
+ [openPlayer],
173
+ );
174
+ }
@@ -0,0 +1,236 @@
1
+ import React, { createContext, useCallback, useContext } from 'react';
2
+ import { usePlayerActivity } from './usePlayerActivity';
3
+ import type { OpenPlayerOptions } from './usePlayerActivity';
4
+
5
+ /**
6
+ * V13+ DX: a lookup function the module calls to resolve a saved
7
+ * resume position for an item. The consumer provides this once at
8
+ * the root of the app; every call site that wants resume-aware
9
+ * openPlayer just passes `resumeId: item.id` to the hook's returned
10
+ * function.
11
+ *
12
+ * Why the consumer provides the lookup (not the module): every
13
+ * project persists bookmarks/history differently — Redux, SQLite,
14
+ * MMKV, AsyncStorage, server-side. The module can't know the
15
+ * shape of the consumer's persistence layer, so the consumer
16
+ * provides a small adapter.
17
+ *
18
+ * The lookup must be **pure and synchronous**. The module calls it
19
+ * inline at `openPlayer(...)` time. If you need async resolution,
20
+ * hydrate the resume position into the consumer's state first and
21
+ * have the lookup return the cached value.
22
+ */
23
+ export interface PlayerResumeLookup {
24
+ /**
25
+ * Returns the saved resume position in milliseconds for the given
26
+ * item id. Return 0 (or undefined) when no saved position exists
27
+ * (file will play from the start).
28
+ */
29
+ getResumePosition(itemId: string): number | undefined;
30
+ }
31
+
32
+ const PlayerResumeContext = createContext<PlayerResumeLookup | null>(null);
33
+
34
+ /**
35
+ * Wrap the consumer app (or any subtree) with a resume lookup.
36
+ * Place this ABOVE every call site of `useOpenWithResume()`. In
37
+ * practice, wrap the same subtree as `<PlayerProvider>` (Phase 54
38
+ * will compose them in PlayerActivity, but for now the consumer
39
+ * can wrap at App.tsx).
40
+ *
41
+ * The actual JSX component lives in `PlayerResumeProvider.tsx` (a
42
+ * `.tsx` file) so the legacy JSX transform doesn't reject the
43
+ * `React.ReactElement` return type. This module re-exports it
44
+ * through the index.
45
+ *
46
+ * @example
47
+ * ```tsx
48
+ * function App() {
49
+ * const lookup = useMemo<PlayerResumeLookup>(() => ({
50
+ * getResumePosition: (id) => store.getState().bookmarks.byId[id]?.position ?? 0,
51
+ * }), []);
52
+ * return (
53
+ * <PlayerResumeProvider lookup={lookup}>
54
+ * <Navigator />
55
+ * </PlayerResumeProvider>
56
+ * );
57
+ * }
58
+ * ```
59
+ */
60
+ export interface PlayerResumeProviderProps {
61
+ lookup: PlayerResumeLookup;
62
+ children: React.ReactNode;
63
+ }
64
+
65
+ /**
66
+ * JSX component that wraps a subtree with the player resume context.
67
+ * Returns the same React tree with the context provider wrapping
68
+ * `children`. Place this above every call site of `useOpenWithResume`.
69
+ */
70
+ export function PlayerResumeProvider({
71
+ lookup,
72
+ children,
73
+ }: PlayerResumeProviderProps): React.ReactElement {
74
+ return (
75
+ <PlayerResumeContext.Provider value={lookup}>
76
+ {children}
77
+ </PlayerResumeContext.Provider>
78
+ );
79
+ }
80
+
81
+ /**
82
+ * DX-friendly alternative to `usePlayerActivity().openPlayer`. The
83
+ * returned function accepts the same `OpenPlayerOptions` as the
84
+ * V13 `usePlayerActivity` hook, plus an optional `resumeId`. When
85
+ * `resumeId` is provided, the module:
86
+ *
87
+ * 1. Reads the saved resume position from the nearest
88
+ * `<PlayerResumeProvider>`'s lookup.
89
+ * 2. Substitutes it for `startPositionMs` (if the consumer didn't
90
+ * already pass one).
91
+ * 3. Calls the underlying `openPlayer` with the resolved options.
92
+ *
93
+ * If no `PlayerResumeProvider` is in scope, the hook behaves
94
+ * identically to `usePlayerActivity().openPlayer` (no resume
95
+ * lookup, no error).
96
+ *
97
+ * This is the pattern the V13 migration prefers: every screen that
98
+ * opens a media item passes `resumeId: item.id` and lets the
99
+ * module handle the resume-position plumbing.
100
+ *
101
+ * @example
102
+ * ```tsx
103
+ * function TrackRow({track}) {
104
+ * const openPlayer = useOpenWithResume();
105
+ * return (
106
+ * <Pressable onPress={() => openPlayer({
107
+ * uri: track.uri,
108
+ * title: track.title,
109
+ * type: 'audio',
110
+ * resumeId: track.id,
111
+ * })}>
112
+ * <Text>{track.title}</Text>
113
+ * </Pressable>
114
+ * );
115
+ * }
116
+ * ```
117
+ */
118
+ export function useOpenWithResume(): (opts: OpenPlayerOptions & {resumeId?: string}) => Promise<boolean> {
119
+ const lookup = useContext(PlayerResumeContext);
120
+ const { openPlayer } = usePlayerActivity();
121
+ return useCallback(
122
+ (opts) => {
123
+ const { resumeId, startPositionMs: providedStartMs, ...rest } = opts;
124
+ // If the consumer passed an explicit startPositionMs, respect it.
125
+ // Otherwise, if a resumeId + lookup are available, ask the lookup.
126
+ // Otherwise, fall back to 0.
127
+ let startPositionMs = providedStartMs ?? 0;
128
+ if (resumeId != null && lookup != null && providedStartMs == null) {
129
+ try {
130
+ const saved = lookup.getResumePosition(resumeId);
131
+ if (typeof saved === 'number' && Number.isFinite(saved) && saved > 0) {
132
+ startPositionMs = saved;
133
+ }
134
+ } catch {
135
+ // Lookup threw — fall back to 0. The consumer's persistence
136
+ // layer is buggy, but the player should still launch.
137
+ }
138
+ }
139
+ return openPlayer({ ...rest, startPositionMs });
140
+ },
141
+ [lookup, openPlayer],
142
+ );
143
+ }
144
+
145
+ /**
146
+ * DX hook for the "press a row to play" pattern. Returns a stable
147
+ * `playItem` function that takes a minimal item shape and a few
148
+ * optional fields, and does the openPlayer wiring. The hook reads
149
+ * the resume position from the nearest `PlayerResumeProvider`
150
+ * automatically.
151
+ *
152
+ * This is sugar on top of `useOpenWithResume` — if the consumer
153
+ * doesn't need this level of abstraction, use `useOpenWithResume`
154
+ * directly.
155
+ *
156
+ * @example
157
+ * ```tsx
158
+ * function TrackRow({track}) {
159
+ * const play = usePlayItem();
160
+ * return <Pressable onPress={() => play(track, {type: 'audio'})}>...</Pressable>;
161
+ * }
162
+ * ```
163
+ */
164
+ export function usePlayItem(): (item: {id: string; uri: string; title: string}, opts: {type: 'video' | 'audio'}) => Promise<boolean> {
165
+ const openPlayer = useOpenWithResume();
166
+ return useCallback(
167
+ (item, opts) =>
168
+ openPlayer({
169
+ uri: item.uri,
170
+ title: item.title,
171
+ type: opts.type,
172
+ resumeId: item.id,
173
+ }),
174
+ [openPlayer],
175
+ );
176
+ }
177
+
178
+ /** Re-export the resume context for advanced consumers (testing, etc.). */
179
+ export { PlayerResumeContext };
180
+
181
+ /**
182
+ * V13+ DX: map a content/media-kind string to a V13 stream type
183
+ * (`'video' | 'audio'`). Useful for consumers that historically
184
+ * passed a content type (`'music'`, `'movie'`, etc.) where V13
185
+ * expects a stream type.
186
+ *
187
+ * The mapping is conservative — anything not in the explicit
188
+ * "video" / "audio" lists falls back to `'audio'` (the safer
189
+ * default; if you need a different default for your app, copy
190
+ * the function and adjust).
191
+ *
192
+ * The map covers the common SIMBA content kinds. Consumers with
193
+ * custom kinds should add their own cases or pre-map before
194
+ * calling.
195
+ *
196
+ * @example
197
+ * ```ts
198
+ * import { resolveStreamType } from '@simba-dev/react-native-media-player';
199
+ *
200
+ * openPlayer({
201
+ * uri: item.uri,
202
+ * title: item.title,
203
+ * type: resolveStreamType(item.kind), // 'music' -> 'audio', 'movie' -> 'video', etc.
204
+ * });
205
+ * ```
206
+ */
207
+ export type ContentKind =
208
+ | 'video' | 'audio' // stream types (passthrough)
209
+ | 'music' | 'audiobook' | 'podcast' | 'radio' | 'archive-audio' // audio content
210
+ | 'movie' | 'episode' | 'live-tv' | 'video-file' // video content
211
+ | string; // unknown — falls back to 'audio'
212
+
213
+ export function resolveStreamType(input: ContentKind): 'video' | 'audio' {
214
+ // Already a stream type — passthrough.
215
+ if (input === 'video' || input === 'audio') return input;
216
+ // Audio content kinds.
217
+ switch (input) {
218
+ case 'music':
219
+ case 'audiobook':
220
+ case 'podcast':
221
+ case 'radio':
222
+ case 'archive-audio':
223
+ return 'audio';
224
+ // Video content kinds.
225
+ case 'movie':
226
+ case 'episode':
227
+ case 'live-tv':
228
+ case 'video-file':
229
+ return 'video';
230
+ default:
231
+ // Unknown kind — conservative default. Better to launch an
232
+ // audio player on an unknown file than to crash on a video
233
+ // mismatch.
234
+ return 'audio';
235
+ }
236
+ }
@@ -0,0 +1,103 @@
1
+ import { useMemo } from 'react';
2
+ import {
3
+ getMpvPlayerModule,
4
+ type LaunchParams,
5
+ } from '../bridge/MpvPlayerModule';
6
+
7
+ /**
8
+ * Options accepted by `usePlayerActivity().openPlayer(opts)`. This is
9
+ * the V13 module-level signature — the consumer's V11 `openPlayer`
10
+ * took `{uri, title, duration, source, type, mediaType}` (the
11
+ * extra fields were Redux-dispatch concerns that V13 drops because
12
+ * there's no Redux dispatch path anymore).
13
+ */
14
+ export interface OpenPlayerOptions {
15
+ /** Media URI (`file://`, `content://`, or `https://`). */
16
+ uri: string;
17
+ /** Display title for the notification / top bar. */
18
+ title: string;
19
+ /** `'video'` launches the full-screen activity; `'audio'` plays in the background. */
20
+ type: 'video' | 'audio';
21
+ /** Resume position in milliseconds. 0 (or omitted) starts from the beginning. */
22
+ startPositionMs?: number;
23
+ }
24
+
25
+ /**
26
+ * V13 Phase 52: thin wrapper around `bridge.openPlayer` +
27
+ * `bridge.getLaunchParams`. Replaces the consumer's V11
28
+ * `usePlaybackCommands()` hook for the 33+ call sites that
29
+ * previously launched `PlayerActivity` from screens like
30
+ * `NowPlaying`, `AllVideos`, `Bookmarks`, etc.
31
+ *
32
+ * Why a separate hook (not just `usePlayer().commands.openPlayer`):
33
+ * - `usePlayer()` requires a `<PlayerProvider>` ancestor for
34
+ * live state; the activity-launch calls happen from screen
35
+ * components (lists, grids) that are NOT inside the player
36
+ * activity yet.
37
+ * - Returning a smaller surface keeps the screen-side code
38
+ * self-documenting: "this screen launches the player" vs
39
+ * "this screen is inside the player".
40
+ * - Easier to mock in consumer-side tests (jest.mock the
41
+ * whole `usePlayerActivity` module).
42
+ *
43
+ * The hook is non-throwing: the bridge resolves to a no-op
44
+ * fallback in jest / web previews, so `openPlayer` resolves with
45
+ * `false` and `getLaunchParams` returns `null` — both clearly
46
+ * falsy, easy to assert against.
47
+ *
48
+ * @example
49
+ * ```tsx
50
+ * function NowPlaying() {
51
+ * const { openPlayer } = usePlayerActivity();
52
+ * const onPressSong = (song: Song) => {
53
+ * openPlayer({
54
+ * uri: song.uri,
55
+ * title: song.title,
56
+ * type: song.hasVideo ? 'video' : 'audio',
57
+ * startPositionMs: song.resumePositionMs,
58
+ * });
59
+ * };
60
+ * // ...
61
+ * }
62
+ * ```
63
+ */
64
+ export interface UsePlayerActivityResult {
65
+ /**
66
+ * Launch the dedicated `PlayerActivity` with the given media.
67
+ * Resolves with `true` on a successful `startActivity` and
68
+ * `false` otherwise (e.g. when the activity is unavailable on
69
+ * the device, the URI is unplayable, or the bridge is in
70
+ * no-op mode).
71
+ */
72
+ openPlayer(opts: OpenPlayerOptions): Promise<boolean>;
73
+ /**
74
+ * One-shot accessor for the launch params the most recent
75
+ * `openPlayer` call handed to `PlayerActivity`. Returns
76
+ * `null` when called from MainActivity or after the first
77
+ * read has already consumed the value. The Kotlin side
78
+ * keeps a single-shot queue, so call this exactly once
79
+ * per `PlayerActivity.onCreate`.
80
+ */
81
+ getLaunchParams(): LaunchParams | null;
82
+ }
83
+
84
+ export function usePlayerActivity(): UsePlayerActivityResult {
85
+ return useMemo<UsePlayerActivityResult>(
86
+ () => ({
87
+ openPlayer: (opts) => {
88
+ const bridge = getMpvPlayerModule();
89
+ return bridge.openPlayer(
90
+ opts.uri,
91
+ opts.title,
92
+ opts.type,
93
+ opts.startPositionMs ?? 0,
94
+ );
95
+ },
96
+ getLaunchParams: () => {
97
+ const bridge = getMpvPlayerModule();
98
+ return bridge.getLaunchParams();
99
+ },
100
+ }),
101
+ [],
102
+ );
103
+ }
@@ -0,0 +1,58 @@
1
+ import {useMemo} from 'react';
2
+ import type {PlayerResumeLookup} from './useOpenWithResume';
3
+
4
+ /**
5
+ * V14 Phase 61: a function the module calls to resolve a saved
6
+ * resume position for a media item. The consumer provides this
7
+ * once at the root of the app; every call site that wants
8
+ * resume-aware openPlayer just passes `resumeId: item.uri` to
9
+ * the hook's returned function.
10
+ *
11
+ * Mirrors the body of `PlayerResumeLookup.getResumePosition` —
12
+ * kept as a named type so `<SimbaPlayer getResumePosition={...}>`
13
+ * has a self-documenting prop type instead of an inline arrow.
14
+ */
15
+ export type GetResumePosition = (itemId: string) => number | undefined;
16
+
17
+ const noopLookup: PlayerResumeLookup = {
18
+ getResumePosition: () => undefined,
19
+ };
20
+
21
+ /**
22
+ * V14 Phase 61: factory hook for a stable `PlayerResumeLookup`.
23
+ *
24
+ * Wraps an optional `selector` function in a memoized
25
+ * `PlayerResumeLookup` object so the lookup reference stays
26
+ * stable across renders. The point of this hook is to ship the
27
+ * **shape** so the consumer's `lookup={}` is always type-safe
28
+ * + stable — the consumer never has to write `useMemo<PlayerResumeLookup>(...)`
29
+ * themselves.
30
+ *
31
+ * Without a selector, returns a no-op lookup (always returns
32
+ * `undefined`).
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * // With a selector (most common):
37
+ * const resumeLookup = useSimbaPlayerLookup((uri) =>
38
+ * store.getState().bookmarks.byFileUri[uri]?.positionMs,
39
+ * );
40
+ *
41
+ * return (
42
+ * <SimbaPlayer lookup={resumeLookup}>
43
+ * <AppContent />
44
+ * </SimbaPlayer>
45
+ * );
46
+ *
47
+ * // Or — the function-prop shape (recommended for new consumers):
48
+ * <SimbaPlayer getResumePosition={(uri) => store.getState().bookmarks.byFileUri[uri]?.positionMs} />
49
+ * ```
50
+ */
51
+ export function useSimbaPlayerLookup(
52
+ selector?: GetResumePosition,
53
+ ): PlayerResumeLookup {
54
+ return useMemo<PlayerResumeLookup>(() => {
55
+ if (!selector) return noopLookup;
56
+ return {getResumePosition: selector};
57
+ }, [selector]);
58
+ }
package/src/index.ts CHANGED
@@ -54,12 +54,50 @@ export {
54
54
  type PlayerCommands,
55
55
  type PlayerProgress,
56
56
  type PlayerState,
57
+ type PlaylistEntry,
57
58
  type UsePlayerResult,
58
59
  } from './types/player';
59
60
 
61
+ export {
62
+ usePlayerActivity,
63
+ type OpenPlayerOptions,
64
+ type UsePlayerActivityResult,
65
+ } from './hooks/usePlayerActivity';
66
+
67
+ export {
68
+ PlayerResumeProvider,
69
+ useOpenWithResume,
70
+ usePlayItem,
71
+ resolveStreamType,
72
+ type ContentKind,
73
+ type PlayerResumeLookup,
74
+ type PlayerResumeProviderProps,
75
+ } from './hooks/useOpenWithResume';
76
+
77
+ export {SimbaPlayer, type SimbaPlayerProps} from './hooks/SimbaPlayer';
78
+ export {
79
+ useSimbaPlayerLookup,
80
+ type GetResumePosition,
81
+ } from './hooks/useSimbaPlayerLookup';
82
+ export {SimbaPlayerRoot, type SimbaPlayerRootProps} from './hooks/SimbaPlayerRoot';
83
+ export {useOpenFromUrl} from './hooks/useOpenFromUrl';
84
+ export {useLaunchParams} from './hooks/useLaunchParams';
85
+
60
86
  export {
61
87
  getMpvPlayerModule,
88
+ subscribePlayerEvent,
89
+ removeAllListeners,
62
90
  setDebugLogging,
63
91
  dumpObservedProperties,
64
92
  type MpvPlayerModuleBridge,
93
+ type PlayerEventName,
94
+ type PlayerEventPayloads,
95
+ type LaunchParams,
96
+ type MpvPlaybackState,
97
+ type MpvLoopMode,
98
+ type MpvTrack,
99
+ type MpvChapter,
100
+ type MpvFileInfo,
101
+ type MpvVideoParams,
102
+ type MpvAudioDevice,
65
103
  } from './bridge/MpvPlayerModule';