react-native-audio-browser 0.2.0-next.54 → 0.2.0-next.55
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.
- package/README.md +32 -19
- package/lib/commonjs/CLAUDE.md +7 -2
- package/lib/commonjs/features/battery.js +16 -12
- package/lib/commonjs/features/battery.js.map +1 -1
- package/lib/commonjs/features/browser-config.js +1 -1
- package/lib/commonjs/features/browser.js +74 -24
- package/lib/commonjs/features/browser.js.map +1 -1
- package/lib/commonjs/features/carConnection.js +3 -4
- package/lib/commonjs/features/carConnection.js.map +1 -1
- package/lib/commonjs/features/equalizer.js +9 -5
- package/lib/commonjs/features/equalizer.js.map +1 -1
- package/lib/commonjs/features/errors.js +35 -21
- package/lib/commonjs/features/errors.js.map +1 -1
- package/lib/commonjs/features/favorites.js +15 -13
- package/lib/commonjs/features/favorites.js.map +1 -1
- package/lib/commonjs/features/gate.js +12 -6
- package/lib/commonjs/features/gate.js.map +1 -1
- package/lib/commonjs/features/metadata.js +16 -14
- package/lib/commonjs/features/metadata.js.map +1 -1
- package/lib/commonjs/features/network.js +5 -1
- package/lib/commonjs/features/network.js.map +1 -1
- package/lib/commonjs/features/nowPlaying.js +28 -14
- package/lib/commonjs/features/nowPlaying.js.map +1 -1
- package/lib/commonjs/features/output.js +8 -4
- package/lib/commonjs/features/output.js.map +1 -1
- package/lib/commonjs/features/playback/controls.js +10 -5
- package/lib/commonjs/features/playback/controls.js.map +1 -1
- package/lib/commonjs/features/playback/playWhenReady.js +6 -5
- package/lib/commonjs/features/playback/playWhenReady.js.map +1 -1
- package/lib/commonjs/features/playback/playing.js +5 -3
- package/lib/commonjs/features/playback/playing.js.map +1 -1
- package/lib/commonjs/features/playback/progress.js +11 -5
- package/lib/commonjs/features/playback/progress.js.map +1 -1
- package/lib/commonjs/features/playback/state.js +3 -3
- package/lib/commonjs/features/playback/state.js.map +1 -1
- package/lib/commonjs/features/playback/trackPlaybackTime.js +6 -1
- package/lib/commonjs/features/playback/trackPlaybackTime.js.map +1 -1
- package/lib/commonjs/features/playback/volume.js +6 -5
- package/lib/commonjs/features/playback/volume.js.map +1 -1
- package/lib/commonjs/features/player/options.js +20 -10
- package/lib/commonjs/features/player/options.js.map +1 -1
- package/lib/commonjs/features/player/setup.js +34 -38
- package/lib/commonjs/features/player/setup.js.map +1 -1
- package/lib/commonjs/features/queue/activeTrack.js +0 -1
- package/lib/commonjs/features/queue/activeTrack.js.map +1 -1
- package/lib/commonjs/features/queue/queue.js +48 -20
- package/lib/commonjs/features/queue/queue.js.map +1 -1
- package/lib/commonjs/features/queue/repeatMode.js +2 -1
- package/lib/commonjs/features/queue/repeatMode.js.map +1 -1
- package/lib/commonjs/features/queue/shuffle.js +0 -1
- package/lib/commonjs/features/queue/shuffle.js.map +1 -1
- package/lib/commonjs/features/remoteControls.js +59 -35
- package/lib/commonjs/features/remoteControls.js.map +1 -1
- package/lib/commonjs/features/sleepTimer.js +15 -6
- package/lib/commonjs/features/sleepTimer.js.map +1 -1
- package/lib/commonjs/utils/LazyNativeEmitter.js +6 -9
- package/lib/commonjs/utils/LazyNativeEmitter.js.map +1 -1
- package/lib/commonjs/utils/NativeUpdatedValue.js +13 -12
- package/lib/commonjs/utils/NativeUpdatedValue.js.map +1 -1
- package/lib/commonjs/utils/getTrackIdentity.js +6 -4
- package/lib/commonjs/utils/getTrackIdentity.js.map +1 -1
- package/lib/commonjs/utils/useDebug.js +16 -3
- package/lib/commonjs/utils/useDebug.js.map +1 -1
- package/lib/commonjs/web/NativeAudioBrowser.js +2 -4
- package/lib/commonjs/web/NativeAudioBrowser.js.map +1 -1
- package/lib/commonjs/web/browser/parseSearchResponse.js +3 -4
- package/lib/commonjs/web/browser/parseSearchResponse.js.map +1 -1
- package/lib/commonjs/web/browser/sections.js +1 -1
- package/lib/commonjs/web/util/BrowserPathHelper.js +1 -3
- package/lib/commonjs/web/util/BrowserPathHelper.js.map +1 -1
- package/lib/module/CLAUDE.md +7 -2
- package/lib/module/features/battery.js +16 -12
- package/lib/module/features/battery.js.map +1 -1
- package/lib/module/features/browser-config.js +1 -1
- package/lib/module/features/browser.js +74 -24
- package/lib/module/features/browser.js.map +1 -1
- package/lib/module/features/carConnection.js +3 -4
- package/lib/module/features/carConnection.js.map +1 -1
- package/lib/module/features/equalizer.js +9 -5
- package/lib/module/features/equalizer.js.map +1 -1
- package/lib/module/features/errors.js +35 -21
- package/lib/module/features/errors.js.map +1 -1
- package/lib/module/features/favorites.js +15 -13
- package/lib/module/features/favorites.js.map +1 -1
- package/lib/module/features/gate.js +12 -6
- package/lib/module/features/gate.js.map +1 -1
- package/lib/module/features/metadata.js +16 -14
- package/lib/module/features/metadata.js.map +1 -1
- package/lib/module/features/network.js +5 -1
- package/lib/module/features/network.js.map +1 -1
- package/lib/module/features/nowPlaying.js +28 -14
- package/lib/module/features/nowPlaying.js.map +1 -1
- package/lib/module/features/output.js +8 -4
- package/lib/module/features/output.js.map +1 -1
- package/lib/module/features/playback/controls.js +10 -5
- package/lib/module/features/playback/controls.js.map +1 -1
- package/lib/module/features/playback/playWhenReady.js +6 -5
- package/lib/module/features/playback/playWhenReady.js.map +1 -1
- package/lib/module/features/playback/playing.js +5 -3
- package/lib/module/features/playback/playing.js.map +1 -1
- package/lib/module/features/playback/progress.js +11 -5
- package/lib/module/features/playback/progress.js.map +1 -1
- package/lib/module/features/playback/state.js +3 -3
- package/lib/module/features/playback/state.js.map +1 -1
- package/lib/module/features/playback/trackPlaybackTime.js +6 -1
- package/lib/module/features/playback/trackPlaybackTime.js.map +1 -1
- package/lib/module/features/playback/volume.js +6 -5
- package/lib/module/features/playback/volume.js.map +1 -1
- package/lib/module/features/player/options.js +20 -10
- package/lib/module/features/player/options.js.map +1 -1
- package/lib/module/features/player/setup.js +34 -38
- package/lib/module/features/player/setup.js.map +1 -1
- package/lib/module/features/queue/activeTrack.js +0 -1
- package/lib/module/features/queue/activeTrack.js.map +1 -1
- package/lib/module/features/queue/queue.js +48 -20
- package/lib/module/features/queue/queue.js.map +1 -1
- package/lib/module/features/queue/repeatMode.js +2 -1
- package/lib/module/features/queue/repeatMode.js.map +1 -1
- package/lib/module/features/queue/shuffle.js +0 -1
- package/lib/module/features/queue/shuffle.js.map +1 -1
- package/lib/module/features/remoteControls.js +59 -35
- package/lib/module/features/remoteControls.js.map +1 -1
- package/lib/module/features/sleepTimer.js +15 -6
- package/lib/module/features/sleepTimer.js.map +1 -1
- package/lib/module/utils/LazyNativeEmitter.js +6 -9
- package/lib/module/utils/LazyNativeEmitter.js.map +1 -1
- package/lib/module/utils/NativeUpdatedValue.js +13 -12
- package/lib/module/utils/NativeUpdatedValue.js.map +1 -1
- package/lib/module/utils/getTrackIdentity.js +6 -4
- package/lib/module/utils/getTrackIdentity.js.map +1 -1
- package/lib/module/utils/useDebug.js +16 -3
- package/lib/module/utils/useDebug.js.map +1 -1
- package/lib/module/web/NativeAudioBrowser.js +2 -4
- package/lib/module/web/NativeAudioBrowser.js.map +1 -1
- package/lib/module/web/browser/parseSearchResponse.js +3 -4
- package/lib/module/web/browser/parseSearchResponse.js.map +1 -1
- package/lib/module/web/browser/sections.js +1 -1
- package/lib/module/web/util/BrowserPathHelper.js +1 -3
- package/lib/module/web/util/BrowserPathHelper.js.map +1 -1
- package/lib/typescript/src/features/battery.d.ts +17 -12
- package/lib/typescript/src/features/battery.d.ts.map +1 -1
- package/lib/typescript/src/features/browser.d.ts +64 -24
- package/lib/typescript/src/features/browser.d.ts.map +1 -1
- package/lib/typescript/src/features/carConnection.d.ts +3 -4
- package/lib/typescript/src/features/carConnection.d.ts.map +1 -1
- package/lib/typescript/src/features/equalizer.d.ts +9 -5
- package/lib/typescript/src/features/equalizer.d.ts.map +1 -1
- package/lib/typescript/src/features/errors.d.ts +37 -22
- package/lib/typescript/src/features/errors.d.ts.map +1 -1
- package/lib/typescript/src/features/favorites.d.ts +15 -13
- package/lib/typescript/src/features/favorites.d.ts.map +1 -1
- package/lib/typescript/src/features/gate.d.ts +14 -8
- package/lib/typescript/src/features/gate.d.ts.map +1 -1
- package/lib/typescript/src/features/metadata.d.ts +37 -17
- package/lib/typescript/src/features/metadata.d.ts.map +1 -1
- package/lib/typescript/src/features/network.d.ts +5 -1
- package/lib/typescript/src/features/network.d.ts.map +1 -1
- package/lib/typescript/src/features/nowPlaying.d.ts +28 -14
- package/lib/typescript/src/features/nowPlaying.d.ts.map +1 -1
- package/lib/typescript/src/features/output.d.ts +8 -4
- package/lib/typescript/src/features/output.d.ts.map +1 -1
- package/lib/typescript/src/features/playback/controls.d.ts +10 -5
- package/lib/typescript/src/features/playback/controls.d.ts.map +1 -1
- package/lib/typescript/src/features/playback/playWhenReady.d.ts +6 -5
- package/lib/typescript/src/features/playback/playWhenReady.d.ts.map +1 -1
- package/lib/typescript/src/features/playback/playing.d.ts +16 -3
- package/lib/typescript/src/features/playback/playing.d.ts.map +1 -1
- package/lib/typescript/src/features/playback/progress.d.ts +11 -5
- package/lib/typescript/src/features/playback/progress.d.ts.map +1 -1
- package/lib/typescript/src/features/playback/state.d.ts +8 -3
- package/lib/typescript/src/features/playback/state.d.ts.map +1 -1
- package/lib/typescript/src/features/playback/trackPlaybackTime.d.ts +9 -2
- package/lib/typescript/src/features/playback/trackPlaybackTime.d.ts.map +1 -1
- package/lib/typescript/src/features/playback/volume.d.ts +6 -5
- package/lib/typescript/src/features/playback/volume.d.ts.map +1 -1
- package/lib/typescript/src/features/player/options.d.ts +52 -37
- package/lib/typescript/src/features/player/options.d.ts.map +1 -1
- package/lib/typescript/src/features/player/setup.d.ts +65 -60
- package/lib/typescript/src/features/player/setup.d.ts.map +1 -1
- package/lib/typescript/src/features/queue/activeTrack.d.ts +0 -1
- package/lib/typescript/src/features/queue/activeTrack.d.ts.map +1 -1
- package/lib/typescript/src/features/queue/queue.d.ts +48 -20
- package/lib/typescript/src/features/queue/queue.d.ts.map +1 -1
- package/lib/typescript/src/features/queue/repeatMode.d.ts +1 -1
- package/lib/typescript/src/features/queue/repeatMode.d.ts.map +1 -1
- package/lib/typescript/src/features/queue/shuffle.d.ts +0 -1
- package/lib/typescript/src/features/queue/shuffle.d.ts.map +1 -1
- package/lib/typescript/src/features/remoteControls.d.ts +58 -25
- package/lib/typescript/src/features/remoteControls.d.ts.map +1 -1
- package/lib/typescript/src/features/sleepTimer.d.ts +15 -7
- package/lib/typescript/src/features/sleepTimer.d.ts.map +1 -1
- package/lib/typescript/src/types/browser-nodes.d.ts +54 -57
- package/lib/typescript/src/types/browser-nodes.d.ts.map +1 -1
- package/lib/typescript/src/types/browser.d.ts +181 -144
- package/lib/typescript/src/types/browser.d.ts.map +1 -1
- package/lib/typescript/src/utils/LazyNativeEmitter.d.ts +6 -9
- package/lib/typescript/src/utils/LazyNativeEmitter.d.ts.map +1 -1
- package/lib/typescript/src/utils/NativeUpdatedValue.d.ts +13 -12
- package/lib/typescript/src/utils/NativeUpdatedValue.d.ts.map +1 -1
- package/lib/typescript/src/utils/getTrackIdentity.d.ts +6 -4
- package/lib/typescript/src/utils/getTrackIdentity.d.ts.map +1 -1
- package/lib/typescript/src/utils/useDebug.d.ts +16 -3
- package/lib/typescript/src/utils/useDebug.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/CLAUDE.md +7 -2
- package/src/docs-floors.test.ts +71 -0
- package/src/features/battery.ts +17 -13
- package/src/features/browser-config.ts +1 -1
- package/src/features/browser.ts +65 -24
- package/src/features/carConnection.ts +3 -4
- package/src/features/equalizer.ts +9 -5
- package/src/features/errors.ts +37 -22
- package/src/features/favorites.ts +15 -13
- package/src/features/gate.ts +14 -8
- package/src/features/metadata.ts +37 -17
- package/src/features/network.ts +5 -1
- package/src/features/nowPlaying.ts +28 -14
- package/src/features/output.ts +8 -4
- package/src/features/playback/controls.ts +10 -5
- package/src/features/playback/playWhenReady.ts +6 -5
- package/src/features/playback/playing.ts +16 -3
- package/src/features/playback/progress.ts +11 -5
- package/src/features/playback/state.ts +8 -3
- package/src/features/playback/trackPlaybackTime.ts +9 -2
- package/src/features/playback/volume.ts +6 -5
- package/src/features/player/options.ts +54 -43
- package/src/features/player/setup.ts +67 -61
- package/src/features/queue/activeTrack.ts +0 -1
- package/src/features/queue/queue.ts +48 -20
- package/src/features/queue/repeatMode.ts +1 -1
- package/src/features/queue/shuffle.ts +0 -1
- package/src/features/remoteControls.ts +59 -35
- package/src/features/sleepTimer.ts +15 -7
- package/src/types/browser-nodes.ts +54 -57
- package/src/types/browser.ts +183 -146
- package/src/utils/LazyNativeEmitter.ts +6 -9
- package/src/utils/NativeUpdatedValue.ts +13 -12
- package/src/utils/getTrackIdentity.ts +6 -4
- package/src/utils/useDebug.ts +16 -3
- package/src/web/NativeAudioBrowser.ts +2 -4
- package/src/web/browser/parseSearchResponse.ts +3 -4
- package/src/web/browser/sections.ts +1 -1
- package/src/web/util/BrowserPathHelper.ts +1 -3
- package/website/guide/android-auto.md +25 -13
- package/website/guide/android-certificates.md +199 -120
- package/website/guide/artwork.md +93 -48
- package/website/guide/audio-output.md +86 -68
- package/website/guide/automotive.md +15 -10
- package/website/guide/basic-usage.md +5 -2
- package/website/guide/battery.md +50 -23
- package/website/guide/browser.md +155 -68
- package/website/guide/carplay.md +132 -49
- package/website/guide/configuration.md +85 -49
- package/website/guide/equalizer.md +36 -32
- package/website/guide/errors.md +106 -64
- package/website/guide/favorites.md +41 -31
- package/website/guide/gate.md +24 -10
- package/website/guide/getting-started.md +55 -2
- package/website/guide/hooks.md +53 -47
- package/website/guide/live-streams.md +80 -49
- package/website/guide/metadata.md +87 -53
- package/website/guide/migrating-from-track-player.md +94 -49
- package/website/guide/native-callback-fetch.md +46 -36
- package/website/guide/network.md +36 -20
- package/website/guide/now-playing.md +72 -44
- package/website/guide/playback.md +112 -35
- package/website/guide/queue.md +77 -43
- package/website/guide/remote-controls.md +87 -29
- package/website/guide/search.md +37 -22
- package/website/guide/sleep-timer.md +35 -14
- package/website/guide/track.md +59 -35
|
@@ -4,9 +4,10 @@ export type { FormattedNavigationError } from '../types/browser';
|
|
|
4
4
|
/**
|
|
5
5
|
* Normalized, cross-platform classification of a playback failure.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Every platform (AVFoundation on iOS, ExoPlayer on Android, Shaka on web)
|
|
8
|
+
* maps its native failure onto this set, so consumers can branch on it without
|
|
9
|
+
* knowing where the error came from. Use this — not `code` — for anything
|
|
10
|
+
* user-visible.
|
|
10
11
|
*
|
|
11
12
|
* - `'offline'` - The device had no network connection at the moment of
|
|
12
13
|
* failure. The stream itself may be fine.
|
|
@@ -14,16 +15,20 @@ export type { FormattedNavigationError } from '../types/browser';
|
|
|
14
15
|
* connection refused, timed out, or the connection dropped while loading.
|
|
15
16
|
* - `'not-found'` - The server said this stream is gone (HTTP 404 / 410).
|
|
16
17
|
* Retrying will not help; the station is dead.
|
|
17
|
-
* - `'rejected'` - The server refused the request
|
|
18
|
-
* geo-blocking or
|
|
18
|
+
* - `'rejected'` - The server refused the request: any HTTP 4xx other than
|
|
19
|
+
* 404 / 410 (auth, geo-blocking, rate limiting), a DRM or licence refusal
|
|
20
|
+
* (Android and web), or a region, account or parental-control refusal
|
|
21
|
+
* (Android).
|
|
19
22
|
* - `'server-error'` - The server responded with 5xx. Usually transient.
|
|
20
|
-
* - `'unplayable'` - The stream
|
|
21
|
-
*
|
|
23
|
+
* - `'unplayable'` - The stream cannot be played: an invalid source URL, a
|
|
24
|
+
* blocked cleartext URL (Android), an unknown container, an unsupported
|
|
25
|
+
* codec, or a decoder failure.
|
|
22
26
|
* - `'stalled'` - Playback had started and then stopped, and the player
|
|
23
27
|
* exhausted its recovery budget without recovering.
|
|
24
28
|
* - `'unknown'` - The failure could not be classified. Inspect `code`.
|
|
25
29
|
*/
|
|
26
30
|
export type PlaybackErrorKind = 'offline' | 'unreachable' | 'not-found' | 'rejected' | 'server-error' | 'unplayable' | 'stalled' | 'unknown';
|
|
31
|
+
/** A classified playback failure: branch on `kind`, log `code`. */
|
|
27
32
|
export type PlaybackError = {
|
|
28
33
|
/** Normalized classification. Branch on this, not on `code`. */
|
|
29
34
|
kind: PlaybackErrorKind;
|
|
@@ -31,9 +36,11 @@ export type PlaybackError = {
|
|
|
31
36
|
* The raw native failure identifier, for diagnostics and telemetry only.
|
|
32
37
|
* Platform-specific and unstable: loader cases on iOS
|
|
33
38
|
* (`failed-to-load`, `playback-failed`, …), lower-cased ExoPlayer error
|
|
34
|
-
* names on Android (`io-bad-http-status`, `parsing-container-malformed`, …)
|
|
39
|
+
* names on Android (`io-bad-http-status`, `parsing-container-malformed`, …),
|
|
40
|
+
* Shaka error codes as strings on web.
|
|
35
41
|
*/
|
|
36
42
|
code: string;
|
|
43
|
+
/** A diagnostic description, not copy for the user. */
|
|
37
44
|
message: string;
|
|
38
45
|
/** HTTP status code, when the failure came from an HTTP response. */
|
|
39
46
|
statusCode?: number;
|
|
@@ -74,13 +81,17 @@ export interface PlaybackErrorEvent {
|
|
|
74
81
|
* Use this for business logic errors like authentication failures or subscription requirements.
|
|
75
82
|
* - `'unknown-error'` - An unexpected error occurred (e.g., invalid configuration).
|
|
76
83
|
* - `'empty-content'` - The path resolved successfully but the container has no children (e.g. an
|
|
77
|
-
* empty Favorites tab, a search with no results).
|
|
84
|
+
* empty Favorites tab, a search with no results). Reaches only the `formatNavigationError`
|
|
85
|
+
* callback, for car-surface copy, never `useNavigationError`.
|
|
78
86
|
* - `'timeout'` - The resolve did not complete within the allotted time (a stalled request or
|
|
79
|
-
* unresponsive bridge).
|
|
87
|
+
* unresponsive bridge). CarPlay only, and like `'empty-content'` it reaches only the
|
|
88
|
+
* `formatNavigationError` callback, never `useNavigationError`.
|
|
80
89
|
*/
|
|
81
90
|
export type NavigationErrorType = 'content-not-found' | 'network-error' | 'http-error' | 'callback-error' | 'unknown-error' | 'empty-content' | 'timeout';
|
|
91
|
+
/** A failed browse or search resolve. */
|
|
82
92
|
export type NavigationError = {
|
|
83
93
|
code: NavigationErrorType;
|
|
94
|
+
/** A diagnostic description, not copy for the user. */
|
|
84
95
|
message: string;
|
|
85
96
|
/** HTTP status code when code is 'http-error' */
|
|
86
97
|
statusCode?: number;
|
|
@@ -99,9 +110,9 @@ export interface NavigationErrorEvent {
|
|
|
99
110
|
*/
|
|
100
111
|
export declare function getPlaybackError(): PlaybackError | undefined;
|
|
101
112
|
/**
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
113
|
+
* Emits when the playback error is set or cleared (`error` is `undefined`
|
|
114
|
+
* when it clears). Subscribe with `addListener`, which returns the
|
|
115
|
+
* unsubscribe function.
|
|
105
116
|
*/
|
|
106
117
|
export declare const onPlaybackError: NativeUpdatedValue<PlaybackErrorEvent>;
|
|
107
118
|
/**
|
|
@@ -115,9 +126,9 @@ export declare function usePlaybackError(): PlaybackError | undefined;
|
|
|
115
126
|
*/
|
|
116
127
|
export declare function getNavigationError(): NavigationError | undefined;
|
|
117
128
|
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
129
|
+
* Emits when the navigation error is set or cleared (`error` is `undefined`
|
|
130
|
+
* when it clears). Subscribe with `addListener`, which returns the
|
|
131
|
+
* unsubscribe function.
|
|
121
132
|
*/
|
|
122
133
|
export declare const onNavigationError: NativeUpdatedValue<NavigationErrorEvent>;
|
|
123
134
|
/**
|
|
@@ -134,19 +145,23 @@ export declare function useNavigationError(): NavigationError | undefined;
|
|
|
134
145
|
*/
|
|
135
146
|
export declare function getFormattedNavigationError(): FormattedNavigationError | undefined;
|
|
136
147
|
/**
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
148
|
+
* Emits each time the formatted navigation error changes. Subscribe with
|
|
149
|
+
* `addListener`, which returns the unsubscribe function.
|
|
140
150
|
*/
|
|
141
151
|
export declare const onFormattedNavigationError: NativeUpdatedValue<FormattedNavigationError | undefined>;
|
|
142
152
|
/**
|
|
143
153
|
* Hook that returns the current navigation error formatted for display.
|
|
144
154
|
*
|
|
145
155
|
* Native formats the error using the `formatNavigationError` callback configured
|
|
146
|
-
* in `BrowserConfiguration`, or falls back to
|
|
156
|
+
* in `BrowserConfiguration`, or falls back to built-in English titles with the
|
|
157
|
+
* error's own message. An HTTP error's title is its status text,
|
|
158
|
+
* system-localized on iOS; on Android an English name for common codes. It is
|
|
159
|
+
* `Server Error` when there is no status code, for codes Android does not
|
|
160
|
+
* name, and always on web.
|
|
147
161
|
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
162
|
+
* CarPlay and Android Auto format their own browse errors with the same
|
|
163
|
+
* `formatNavigationError` callback, so the copy matches across your app and
|
|
164
|
+
* the car.
|
|
150
165
|
*
|
|
151
166
|
* @returns Formatted error with title and message, or undefined if no error
|
|
152
167
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/features/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAEhE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAIhE,YAAY,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAEhE
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/features/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAEhE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAIhE,YAAY,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,MAAM,iBAAiB,GACzB,SAAS,GACT,aAAa,GACb,WAAW,GACX,UAAU,GACV,cAAc,GACd,YAAY,GACZ,SAAS,GACT,SAAS,CAAA;AAEb,mEAAmE;AACnE,MAAM,MAAM,aAAa,GAAG;IAC1B,gEAAgE;IAChE,IAAI,EAAE,iBAAiB,CAAA;IACvB;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAA;IACf,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,mBAAmB,GAC3B,mBAAmB,GACnB,eAAe,GACf,YAAY,GACZ,gBAAgB,GAChB,eAAe,GACf,eAAe,GACf,SAAS,CAAA;AAEb,yCAAyC;AACzC,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,mBAAmB,CAAA;IACzB,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAA;IACf,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,+FAA+F;IAC/F,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,eAAe,CAAA;CACxB;AAID;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,GAAG,SAAS,CAE5D;AAID;;;;GAIG;AACH,eAAO,MAAM,eAAe,wCAGzB,CAAA;AAIH;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,GAAG,SAAS,CAE5D;AAID;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,GAAG,SAAS,CAGhE;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,0CAG3B,CAAA;AAEH;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,GAAG,SAAS,CAEhE;AAID;;;;;;GAMG;AACH,wBAAgB,2BAA2B,IACvC,wBAAwB,GACxB,SAAS,CAEZ;AAED;;;GAGG;AACH,eAAO,MAAM,0BAA0B,0DAEmB,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,2BAA2B,IACvC,wBAAwB,GACxB,SAAS,CAKZ"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Track } from '../types';
|
|
2
2
|
import { NativeUpdatedValue } from '../utils/NativeUpdatedValue';
|
|
3
3
|
/**
|
|
4
|
-
* Sets the favorited state of the
|
|
5
|
-
* Updates the heart icon in media controllers (notification, Android Auto).
|
|
4
|
+
* Sets the favorited state of the Active Track.
|
|
5
|
+
* Updates the heart icon in media controllers (notification, Android Auto, CarPlay).
|
|
6
6
|
*
|
|
7
|
-
* Use this for
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Use this for favorite changes from your app, such as a favorite button.
|
|
8
|
+
* It emits `onFavoriteChanged`, so persist the change there, not again in your
|
|
9
|
+
* button handler.
|
|
10
10
|
*
|
|
11
11
|
* @param favorited - Whether the track is favorited
|
|
12
12
|
*
|
|
@@ -17,7 +17,7 @@ import { NativeUpdatedValue } from '../utils/NativeUpdatedValue';
|
|
|
17
17
|
*/
|
|
18
18
|
export declare function setActiveTrackFavorited(favorited: boolean): void;
|
|
19
19
|
/**
|
|
20
|
-
* Toggles the favorited state of the
|
|
20
|
+
* Toggles the favorited state of the Active Track. Emits `onFavoriteChanged`.
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```ts
|
|
@@ -54,8 +54,10 @@ export declare function toggleActiveTrackFavorited(): void;
|
|
|
54
54
|
*/
|
|
55
55
|
export declare function setFavorites(favorites: string[]): void;
|
|
56
56
|
/**
|
|
57
|
-
* Event data for when the favorite state of the
|
|
58
|
-
* Emitted
|
|
57
|
+
* Event data for when the favorite state of the Active Track changes.
|
|
58
|
+
* Emitted on every change: a heart tap in a media controller (notification,
|
|
59
|
+
* Android Auto, CarPlay), a Siri request (iOS), `setActiveTrackFavorited` or
|
|
60
|
+
* `toggleActiveTrackFavorited`.
|
|
59
61
|
*/
|
|
60
62
|
export interface FavoriteChangedEvent {
|
|
61
63
|
/** The track whose favorite state changed. */
|
|
@@ -64,11 +66,11 @@ export interface FavoriteChangedEvent {
|
|
|
64
66
|
favorited: boolean;
|
|
65
67
|
}
|
|
66
68
|
/**
|
|
67
|
-
* Subscribes to favorite
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
69
|
+
* Subscribes to favorite changes of the Active Track, with the track and its
|
|
70
|
+
* new favorite state. Fires on every change: a heart tap in a media controller,
|
|
71
|
+
* a Siri request (iOS), `setActiveTrackFavorited` or
|
|
72
|
+
* `toggleActiveTrackFavorited`. Persist favorites here, in one place. The
|
|
73
|
+
* native side has already updated the track's favorite state and UI.
|
|
72
74
|
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
73
75
|
*
|
|
74
76
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"favorites.d.ts","sourceRoot":"","sources":["../../../../src/features/favorites.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAErC,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAIhE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAEhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,IAAI,IAAI,CAEjD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,CAEtD;AAID
|
|
1
|
+
{"version":3,"file":"favorites.d.ts","sourceRoot":"","sources":["../../../../src/features/favorites.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAErC,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAIhE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAEhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,IAAI,IAAI,CAEjD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,CAEtD;AAID;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,8CAA8C;IAC9C,KAAK,EAAE,KAAK,CAAA;IACZ,8BAA8B;IAC9B,SAAS,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,iBAAiB,0CAG3B,CAAA"}
|
|
@@ -16,19 +16,22 @@ export type GateEvent = {
|
|
|
16
16
|
/**
|
|
17
17
|
* A gate's chrome (title and optional message).
|
|
18
18
|
*
|
|
19
|
-
* While the gate is
|
|
20
|
-
*
|
|
21
|
-
*
|
|
19
|
+
* While the gate is up, a gated browse or search on CarPlay or Android Auto
|
|
20
|
+
* shows this page instead of the content, and a gated voice search (Siri on
|
|
21
|
+
* iOS, Google Assistant on Android, including from the phone) is refused.
|
|
22
|
+
* Playback and the queue are unaffected.
|
|
22
23
|
*
|
|
23
|
-
* - **CarPlay**: plain centered message page.
|
|
24
|
-
*
|
|
24
|
+
* - **CarPlay**: plain centered message page. Now Playing keeps its transport
|
|
25
|
+
* controls but hides the `carPlayNowPlayingButtons`.
|
|
26
|
+
* - **Android Auto**: one non-playable list tile, with the title as its main
|
|
27
|
+
* line and the message as its subtitle.
|
|
25
28
|
*/
|
|
26
29
|
export type Gate = {
|
|
27
30
|
/** Headline shown on the gate page. */
|
|
28
31
|
title: string;
|
|
29
32
|
/**
|
|
30
|
-
* The explanatory copy under the title
|
|
31
|
-
*
|
|
33
|
+
* The explanatory copy under the title: the centered message body on
|
|
34
|
+
* CarPlay, the tile subtitle on Android Auto. Newlines become spaces on both.
|
|
32
35
|
*/
|
|
33
36
|
message?: string;
|
|
34
37
|
};
|
|
@@ -49,6 +52,8 @@ export type GateRequest = {
|
|
|
49
52
|
* - Return a {@link Gate} to gate with specific chrome for this request.
|
|
50
53
|
* - Return `true` to gate using the default chrome (or the built-in fallback).
|
|
51
54
|
* - Return `false` to allow the request through.
|
|
55
|
+
* - If the resolver throws, the request is gated (fails closed): only `false`
|
|
56
|
+
* lets a request through.
|
|
52
57
|
*/
|
|
53
58
|
export type GateResolver = (request: GateRequest) => Gate | boolean;
|
|
54
59
|
/**
|
|
@@ -75,7 +80,8 @@ export declare function setGate(gate: Gate, resolve?: GateResolver): void;
|
|
|
75
80
|
*/
|
|
76
81
|
export declare function setGate(resolve: GateResolver): void;
|
|
77
82
|
/**
|
|
78
|
-
* Drops the gate — the real content comes back
|
|
83
|
+
* Drops the gate — the real content comes back. Android Auto keeps the current
|
|
84
|
+
* tab; CarPlay rebuilds its tab bar on the first tab.
|
|
79
85
|
*
|
|
80
86
|
* @platform ios android
|
|
81
87
|
* A no-op on web, where no gate was ever raised.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../../../../src/features/gate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAI9D,iDAAiD;AACjD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAmB5C;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GAAG;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,CAAA;AAI9C
|
|
1
|
+
{"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../../../../src/features/gate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAI9D,iDAAiD;AACjD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAmB5C;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GAAG;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,CAAA;AAI9C;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,IAAI,GAAG;IACjB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAQD;;;;GAIG;AACH,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,CAAA;AAE5C;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAA;AAoCnE;;;;;;;;;;;;GAYG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;AACjE;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAAA;AAWpD;;;;;;GAMG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAGhC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,8BAElB,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NativeUpdatedValue } from '../utils/NativeUpdatedValue';
|
|
2
|
+
/** The track fields {@link NowPlayingMetadata} carries. */
|
|
2
3
|
export interface TrackMetadataBase {
|
|
3
4
|
/** The track title */
|
|
4
5
|
title?: string;
|
|
@@ -12,18 +13,27 @@ export interface TrackMetadataBase {
|
|
|
12
13
|
artwork?: string;
|
|
13
14
|
/** track description */
|
|
14
15
|
description?: string;
|
|
15
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* The track's `src`, or its `path` when it has none, on iOS and Android.
|
|
18
|
+
* On web, the track's Identity (`id` when set, else `src`), or its `path`:
|
|
19
|
+
* a track with an `id` reports different values on web and native.
|
|
20
|
+
*/
|
|
16
21
|
mediaId?: string;
|
|
17
22
|
/** The track genre */
|
|
18
23
|
genre?: string;
|
|
19
24
|
}
|
|
20
25
|
export interface NowPlayingMetadata extends TrackMetadataBase {
|
|
26
|
+
/**
|
|
27
|
+
* Playback position in seconds when this metadata was emitted or read, not
|
|
28
|
+
* a live value. iOS only; absent on Android and web. For a live position use
|
|
29
|
+
* `useProgress`.
|
|
30
|
+
*/
|
|
21
31
|
elapsedTime?: number;
|
|
22
32
|
}
|
|
23
33
|
/**
|
|
24
34
|
* Metadata update for the now playing notification.
|
|
25
|
-
* Pass to `updateNowPlaying()` to override what's shown in the
|
|
26
|
-
*
|
|
35
|
+
* Pass to `updateNowPlaying()` to override what's shown in the
|
|
36
|
+
* notification/lock screen; pass it `null` to clear the override.
|
|
27
37
|
*/
|
|
28
38
|
export type NowPlayingUpdate = {
|
|
29
39
|
/** Title shown in notification */
|
|
@@ -38,8 +48,8 @@ export type NowPlayingUpdate = {
|
|
|
38
48
|
album?: string;
|
|
39
49
|
};
|
|
40
50
|
/**
|
|
41
|
-
* Timed metadata received during playback.
|
|
42
|
-
*
|
|
51
|
+
* Timed metadata received during playback: ICY (radio) or ID3 frames.
|
|
52
|
+
* On iOS, also a file's own tags, once on load, when the file has no chapters.
|
|
43
53
|
*/
|
|
44
54
|
export interface TimedMetadata {
|
|
45
55
|
title?: string;
|
|
@@ -49,8 +59,9 @@ export interface TimedMetadata {
|
|
|
49
59
|
genre?: string;
|
|
50
60
|
}
|
|
51
61
|
/**
|
|
52
|
-
* Static track metadata
|
|
53
|
-
*
|
|
62
|
+
* Static track metadata. On iOS, the media file's own tags. On Android,
|
|
63
|
+
* Media3's merged metadata, where the Track's fields and the now-playing lines win over
|
|
64
|
+
* the file's tags. `compilation` and `url` are never set.
|
|
54
65
|
*/
|
|
55
66
|
export interface TrackMetadata {
|
|
56
67
|
title?: string;
|
|
@@ -58,14 +69,24 @@ export interface TrackMetadata {
|
|
|
58
69
|
albumTitle?: string;
|
|
59
70
|
subtitle?: string;
|
|
60
71
|
description?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Android only: the artwork URL published for the Track, not embedded
|
|
74
|
+
* cover art.
|
|
75
|
+
*/
|
|
61
76
|
artworkUri?: string;
|
|
62
77
|
trackNumber?: string;
|
|
63
78
|
composer?: string;
|
|
64
79
|
conductor?: string;
|
|
65
80
|
genre?: string;
|
|
66
81
|
compilation?: string;
|
|
82
|
+
/** Android only: the station name from a Shoutcast / Icecast stream. */
|
|
67
83
|
station?: string;
|
|
84
|
+
/** Android only: a Media3 `MEDIA_TYPE_*` constant, as a number string. */
|
|
68
85
|
mediaType?: string;
|
|
86
|
+
/**
|
|
87
|
+
* iOS: the tag's date string. Android: day and month only, as `DDMM` (or
|
|
88
|
+
* `DD` or `MM`), no year.
|
|
89
|
+
*/
|
|
69
90
|
creationDate?: string;
|
|
70
91
|
creationYear?: string;
|
|
71
92
|
url?: string;
|
|
@@ -79,9 +100,9 @@ export interface ChapterMetadata {
|
|
|
79
100
|
startTime: number;
|
|
80
101
|
/** Chapter end time in seconds */
|
|
81
102
|
endTime: number;
|
|
82
|
-
/** Chapter title */
|
|
103
|
+
/** Chapter title. Android falls back to the chapter's element ID. */
|
|
83
104
|
title?: string;
|
|
84
|
-
/** URL associated with the chapter */
|
|
105
|
+
/** URL associated with the chapter. Android only. */
|
|
85
106
|
url?: string;
|
|
86
107
|
}
|
|
87
108
|
/**
|
|
@@ -91,31 +112,30 @@ export interface ChapterMetadata {
|
|
|
91
112
|
* Never fires on web — the web player does not read chapter markers. See
|
|
92
113
|
* {@link https://github.com/radio-garden/react-native-audio-browser/issues/118 | #118}.
|
|
93
114
|
*
|
|
94
|
-
* @param callback - Called when chapter metadata is received
|
|
95
115
|
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
96
116
|
*/
|
|
97
117
|
export declare const onChapterMetadata: NativeUpdatedValue<ChapterMetadata[]>;
|
|
98
118
|
/**
|
|
99
|
-
* Subscribes to track metadata events.
|
|
119
|
+
* Subscribes to track metadata events. On iOS it fires once on load, when the
|
|
120
|
+
* file has tags. On Android it fires whenever the player's merged metadata
|
|
121
|
+
* changes.
|
|
100
122
|
*
|
|
101
123
|
* @platform ios android
|
|
102
124
|
* Never fires on web — the web player does not read embedded file tags. See
|
|
103
125
|
* {@link https://github.com/radio-garden/react-native-audio-browser/issues/118 | #118}.
|
|
104
126
|
*
|
|
105
|
-
* @param callback - Called when static track metadata is received
|
|
106
127
|
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
107
128
|
*/
|
|
108
129
|
export declare const onTrackMetadata: NativeUpdatedValue<TrackMetadata>;
|
|
109
130
|
/**
|
|
110
|
-
* Subscribes to timed metadata events (ICY/ID3 from live streams).
|
|
131
|
+
* Subscribes to timed metadata events (ICY/ID3 from live streams). On iOS it
|
|
132
|
+
* also fires on load with a file's own tags when the file has no chapters.
|
|
111
133
|
*
|
|
112
134
|
* @platform ios android
|
|
113
|
-
* Never fires on web
|
|
114
|
-
*
|
|
115
|
-
* but not yet wired. See
|
|
135
|
+
* Never fires on web: the browser strips ICY metadata before the player sees
|
|
136
|
+
* it, and the web player does not read in-band ID3 from HLS. See
|
|
116
137
|
* {@link https://github.com/radio-garden/react-native-audio-browser/issues/118 | #118}.
|
|
117
138
|
*
|
|
118
|
-
* @param callback - Called when stream metadata is received (title, artist from ICY/ID3 tags)
|
|
119
139
|
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
120
140
|
*/
|
|
121
141
|
export declare const onTimedMetadata: NativeUpdatedValue<TimedMetadata>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../../src/features/metadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAIhE,MAAM,WAAW,iBAAiB;IAChC,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,uBAAuB;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,oCAAoC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,wBAAwB;IACxB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,wBAAwB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../../src/features/metadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAIhE,2DAA2D;AAC3D,MAAM,WAAW,iBAAiB;IAChC,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,uBAAuB;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,oCAAoC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,wBAAwB;IACxB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,wBAAwB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAA;IACjB,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qDAAqD;IACrD,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAID;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,uCAEmB,CAAA;AAEjD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,mCAE3B,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,mCAE3B,CAAA"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { NativeUpdatedValue } from '../utils/NativeUpdatedValue';
|
|
2
2
|
/**
|
|
3
3
|
* Gets the current network connectivity state.
|
|
4
|
+
* On Android it reads `true` before `setupPlayer` has connected the player, and
|
|
5
|
+
* while its service restarts.
|
|
4
6
|
* @returns true if the device is online, false otherwise
|
|
5
7
|
*/
|
|
6
8
|
export declare function getOnline(): boolean;
|
|
7
9
|
/**
|
|
8
10
|
* Subscribes to network connectivity changes.
|
|
9
|
-
*
|
|
11
|
+
* On Android it fires nothing until `setupPlayer` has connected the player, and then
|
|
12
|
+
* fires once with the current state.
|
|
10
13
|
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
11
14
|
*/
|
|
12
15
|
export declare const onOnlineChanged: NativeUpdatedValue<boolean>;
|
|
13
16
|
/**
|
|
14
17
|
* Hook that returns the current network connectivity state and updates when it changes.
|
|
18
|
+
* On Android it reads `true` until `setupPlayer` has connected the player.
|
|
15
19
|
* @returns true if the device is online, false otherwise
|
|
16
20
|
*/
|
|
17
21
|
export declare function useOnline(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../../../src/features/network.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAKhE
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../../../src/features/network.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAKhE;;;;;GAKG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAEnC;AAID;;;;;GAKG;AACH,eAAO,MAAM,eAAe,6BAE3B,CAAA;AAID;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAEnC"}
|
|
@@ -2,7 +2,11 @@ import type { NowPlayingMetadata, NowPlayingUpdate } from './metadata';
|
|
|
2
2
|
import { NativeUpdatedValue } from '../utils/NativeUpdatedValue';
|
|
3
3
|
/**
|
|
4
4
|
* Updates the now playing notification metadata.
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
|
+
* Lasts until you pass `null`, which clears it, or the active track changes. A `nowPlaying`
|
|
7
|
+
* formatter's fields win over it. With `nowPlaying: false` the iOS and
|
|
8
|
+
* Android surface ignores it, though `getNowPlaying` still reports it; web
|
|
9
|
+
* ignores `nowPlaying`.
|
|
6
10
|
*
|
|
7
11
|
* @example
|
|
8
12
|
* ```ts
|
|
@@ -12,26 +16,33 @@ import { NativeUpdatedValue } from '../utils/NativeUpdatedValue';
|
|
|
12
16
|
* artist: streamMetadata.artist,
|
|
13
17
|
* })
|
|
14
18
|
*
|
|
15
|
-
* // Clear
|
|
19
|
+
* // Clear the override
|
|
16
20
|
* updateNowPlaying(null)
|
|
17
21
|
* ```
|
|
18
22
|
*/
|
|
19
23
|
export declare function updateNowPlaying(update: NowPlayingUpdate | null): void;
|
|
20
24
|
/**
|
|
21
|
-
*
|
|
25
|
+
* Returns what the now-playing surface shows: flash, formatter output,
|
|
26
|
+
* override or track fields, in that priority. `undefined` when there is no
|
|
27
|
+
* active track. With `nowPlaying: false`, it returns the flash, override or
|
|
28
|
+
* track fields, regardless of what the surface shows.
|
|
22
29
|
*/
|
|
23
30
|
export declare function getNowPlaying(): NowPlayingMetadata | undefined;
|
|
24
31
|
/**
|
|
25
32
|
* Temporarily replaces now-playing fields for `durationMs`, then reverts to
|
|
26
|
-
* the live metadata.
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
33
|
+
* the live metadata. While active it outranks the `nowPlaying` formatter
|
|
34
|
+
* ({@link features/player!FormatNowPlayingCallback | FormatNowPlayingCallback}) and the `updateNowPlaying` override.
|
|
35
|
+
* The revert runs on a native timer, so it fires while the app is
|
|
36
|
+
* backgrounded. A track change clears the flash early; repeated calls
|
|
37
|
+
* restart the window.
|
|
38
|
+
*
|
|
39
|
+
* On web the flash is a plain `updateNowPlaying` override on a JS timer. It
|
|
40
|
+
* replaces any override you set, the revert clears the override instead of
|
|
41
|
+
* restoring it, and a track change does not cancel the timer, so the revert
|
|
42
|
+
* can also clear an override set for the next track. With
|
|
43
|
+
* `nowPlaying: false`, Android ignores the flash; iOS still shows it.
|
|
31
44
|
*
|
|
32
|
-
*
|
|
33
|
-
* no toast primitive, so a transient metadata swap is the only way to talk
|
|
34
|
-
* to the user there.
|
|
45
|
+
* See the [Now playing guide](https://audiobrowser.dev/guide/now-playing#the-flash-transient-top-priority).
|
|
35
46
|
*
|
|
36
47
|
* @example
|
|
37
48
|
* ```ts
|
|
@@ -45,13 +56,16 @@ export declare function getNowPlaying(): NowPlayingMetadata | undefined;
|
|
|
45
56
|
export declare function flashNowPlaying(update: NowPlayingUpdate, durationMs: number): void;
|
|
46
57
|
/**
|
|
47
58
|
* Clears an active flash immediately, reverting to the live metadata.
|
|
48
|
-
* No-op when no flash is active.
|
|
59
|
+
* No-op when no flash is active. On web it also clears the
|
|
60
|
+
* `updateNowPlaying` override.
|
|
49
61
|
*/
|
|
50
62
|
export declare function clearNowPlayingFlash(): void;
|
|
51
63
|
/**
|
|
52
64
|
* Subscribes to now playing metadata change events.
|
|
53
|
-
* Fires when
|
|
54
|
-
*
|
|
65
|
+
* Fires when the now-playing lines change: track change, `updateNowPlaying`,
|
|
66
|
+
* a flash starting or ending, or a new formatter result. On iOS and
|
|
67
|
+
* Android, an update that leaves the lines unchanged does not fire; on web
|
|
68
|
+
* every `updateNowPlaying` call, flash start and revert fires.
|
|
55
69
|
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
56
70
|
*/
|
|
57
71
|
export declare const onNowPlayingChanged: NativeUpdatedValue<NowPlayingMetadata>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nowPlaying.d.ts","sourceRoot":"","sources":["../../../../src/features/nowPlaying.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAKhE
|
|
1
|
+
{"version":3,"file":"nowPlaying.d.ts","sourceRoot":"","sources":["../../../../src/features/nowPlaying.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAKhE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAEtE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,kBAAkB,GAAG,SAAS,CAE9D;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,gBAAgB,EACxB,UAAU,EAAE,MAAM,GACjB,IAAI,CAEN;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAID;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,wCAG7B,CAAA;AAIH;;;GAGG;AACH,wBAAgB,aAAa,IAAI,kBAAkB,GAAG,SAAS,CAE9D"}
|
|
@@ -19,15 +19,19 @@ export declare function openOutputPicker(): void;
|
|
|
19
19
|
export declare function supportsOutputSwitcher(): boolean;
|
|
20
20
|
/**
|
|
21
21
|
* The current audio output, or `undefined` when unknown. iOS reports one while a
|
|
22
|
-
* session is active
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* session is active. Android reports the device media is routed to, from
|
|
23
|
+
* AudioManager, or the remote output selected in the Output Switcher when
|
|
24
|
+
* `remoteOutputs` is on. On Android 13+ (API 33) the route is exact and follows
|
|
25
|
+
* manual reroutes. Below that it is picked from the connected devices and misses
|
|
26
|
+
* a reroute while a device stays connected.
|
|
25
27
|
* Guard for `undefined`.
|
|
26
28
|
*/
|
|
27
29
|
export declare function getOutput(): Output | undefined;
|
|
28
30
|
/**
|
|
29
31
|
* Subscribes to current-output changes (headphones unplugged, Bluetooth speaker
|
|
30
|
-
* connected, AirPlay/route selected). Fires on iOS and Android
|
|
32
|
+
* connected, AirPlay/route selected). Fires on iOS and Android; never on web.
|
|
33
|
+
* On Android below 13 it cannot see a manual reroute between two connected
|
|
34
|
+
* devices.
|
|
31
35
|
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
32
36
|
*/
|
|
33
37
|
export declare const onOutputChanged: NativeUpdatedValue<Output>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../../src/features/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAGhE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,CAAA;AAIlC;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAID
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../../src/features/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAGhE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,CAAA;AAIlC;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAID;;;;;;;;GAQG;AACH,wBAAgB,SAAS,IAAI,MAAM,GAAG,SAAS,CAE9C;AAID;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,4BAE3B,CAAA;AAID;;;GAGG;AACH,wBAAgB,SAAS,IAAI,MAAM,GAAG,SAAS,CAE9C"}
|
|
@@ -15,13 +15,17 @@ export declare function pause(): void;
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function togglePlayback(): void;
|
|
17
17
|
/**
|
|
18
|
-
* Stops playback and
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* Stops playback. The track stays current, and play() starts it again.
|
|
19
|
+
* iOS rewinds a non-live track to the start; Android and web keep the
|
|
20
|
+
* position, so play() resumes where it stopped.
|
|
21
21
|
*/
|
|
22
22
|
export declare function stop(): void;
|
|
23
23
|
/**
|
|
24
|
-
* Retries playing the current item
|
|
24
|
+
* Retries playing the current item. Meant for the `'error'` state, but not
|
|
25
|
+
* gated on it: on iOS it reloads the current item in any state, even while
|
|
26
|
+
* playing. On Android and web it reloads whenever the player is stopped or
|
|
27
|
+
* failed, without setting the play intent, so after stop() it loads the item
|
|
28
|
+
* but does not play it.
|
|
25
29
|
*
|
|
26
30
|
* @see {@link PlaybackState}
|
|
27
31
|
* @see {@link usePlayback}
|
|
@@ -36,7 +40,8 @@ export declare function seekTo(position: number): void;
|
|
|
36
40
|
* Jump to the live edge of the current track; no-op unless the track
|
|
37
41
|
* declares `live: true`. A stream with a seekable live window (HLS) seeks
|
|
38
42
|
* to the window's edge; a non-seekable stream (e.g. ICY radio) reconnects
|
|
39
|
-
* to rejoin live
|
|
43
|
+
* to rejoin live. iOS re-runs `media.resolve` on the reconnect; Android
|
|
44
|
+
* reuses the resolved URL and re-resolves only after it fails to open.
|
|
40
45
|
*/
|
|
41
46
|
export declare function seekToLiveEdge(): void;
|
|
42
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../../../../src/features/playback/controls.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,KAAK,IAAI,IAAI,CAE5B;AAED;;GAEG;AACH,wBAAgB,IAAI,IAAI,IAAI,CAE3B;AAED;;GAEG;AACH,wBAAgB,KAAK,IAAI,IAAI,CAE5B;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAErC;AAED;;;;GAIG;AACH,wBAAgB,IAAI,IAAI,IAAI,CAE3B;AAED
|
|
1
|
+
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../../../../src/features/playback/controls.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,KAAK,IAAI,IAAI,CAE5B;AAED;;GAEG;AACH,wBAAgB,IAAI,IAAI,IAAI,CAE3B;AAED;;GAEG;AACH,wBAAgB,KAAK,IAAI,IAAI,CAE5B;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAErC;AAED;;;;GAIG;AACH,wBAAgB,IAAI,IAAI,IAAI,CAE3B;AAED;;;;;;;;;GASG;AACH,wBAAgB,KAAK,IAAI,IAAI,CAE5B;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAE7C;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAErC;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAE3C"}
|
|
@@ -12,14 +12,15 @@ export interface PlaybackPlayWhenReadyChangedEvent {
|
|
|
12
12
|
export declare function getPlayWhenReady(): boolean;
|
|
13
13
|
/**
|
|
14
14
|
* Sets whether the player will play automatically when it is ready to do so.
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* Before setupPlayer resolves, the value is kept and applied at setup, while
|
|
16
|
+
* play() is dropped on iOS and Android. On Android, `true` does not restart a
|
|
17
|
+
* stopped or failed player; call play() or retry() for that.
|
|
17
18
|
*/
|
|
18
19
|
export declare function setPlayWhenReady(playWhenReady: boolean): void;
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* Emits each time `playWhenReady` changes. Subscribe with
|
|
22
|
+
* `onPlayWhenReadyChanged.addListener(cb)`, which returns an unsubscribe
|
|
23
|
+
* function.
|
|
23
24
|
*/
|
|
24
25
|
export declare const onPlayWhenReadyChanged: NativeUpdatedValue<PlaybackPlayWhenReadyChangedEvent>;
|
|
25
26
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playWhenReady.d.ts","sourceRoot":"","sources":["../../../../../src/features/playback/playWhenReady.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAGnE;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD,8CAA8C;IAC9C,aAAa,EAAE,OAAO,CAAA;CACvB;AAID;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAID
|
|
1
|
+
{"version":3,"file":"playWhenReady.d.ts","sourceRoot":"","sources":["../../../../../src/features/playback/playWhenReady.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAGnE;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD,8CAA8C;IAC9C,aAAa,EAAE,OAAO,CAAA;CACvB;AAID;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAID;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,OAAO,GAAG,IAAI,CAE7D;AAID;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,uDAGhC,CAAA;AAIH;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAM1C"}
|