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.
Files changed (271) hide show
  1. package/README.md +32 -19
  2. package/lib/commonjs/CLAUDE.md +7 -2
  3. package/lib/commonjs/features/battery.js +16 -12
  4. package/lib/commonjs/features/battery.js.map +1 -1
  5. package/lib/commonjs/features/browser-config.js +1 -1
  6. package/lib/commonjs/features/browser.js +74 -24
  7. package/lib/commonjs/features/browser.js.map +1 -1
  8. package/lib/commonjs/features/carConnection.js +3 -4
  9. package/lib/commonjs/features/carConnection.js.map +1 -1
  10. package/lib/commonjs/features/equalizer.js +9 -5
  11. package/lib/commonjs/features/equalizer.js.map +1 -1
  12. package/lib/commonjs/features/errors.js +35 -21
  13. package/lib/commonjs/features/errors.js.map +1 -1
  14. package/lib/commonjs/features/favorites.js +15 -13
  15. package/lib/commonjs/features/favorites.js.map +1 -1
  16. package/lib/commonjs/features/gate.js +12 -6
  17. package/lib/commonjs/features/gate.js.map +1 -1
  18. package/lib/commonjs/features/metadata.js +16 -14
  19. package/lib/commonjs/features/metadata.js.map +1 -1
  20. package/lib/commonjs/features/network.js +5 -1
  21. package/lib/commonjs/features/network.js.map +1 -1
  22. package/lib/commonjs/features/nowPlaying.js +28 -14
  23. package/lib/commonjs/features/nowPlaying.js.map +1 -1
  24. package/lib/commonjs/features/output.js +8 -4
  25. package/lib/commonjs/features/output.js.map +1 -1
  26. package/lib/commonjs/features/playback/controls.js +10 -5
  27. package/lib/commonjs/features/playback/controls.js.map +1 -1
  28. package/lib/commonjs/features/playback/playWhenReady.js +6 -5
  29. package/lib/commonjs/features/playback/playWhenReady.js.map +1 -1
  30. package/lib/commonjs/features/playback/playing.js +5 -3
  31. package/lib/commonjs/features/playback/playing.js.map +1 -1
  32. package/lib/commonjs/features/playback/progress.js +11 -5
  33. package/lib/commonjs/features/playback/progress.js.map +1 -1
  34. package/lib/commonjs/features/playback/state.js +3 -3
  35. package/lib/commonjs/features/playback/state.js.map +1 -1
  36. package/lib/commonjs/features/playback/trackPlaybackTime.js +6 -1
  37. package/lib/commonjs/features/playback/trackPlaybackTime.js.map +1 -1
  38. package/lib/commonjs/features/playback/volume.js +6 -5
  39. package/lib/commonjs/features/playback/volume.js.map +1 -1
  40. package/lib/commonjs/features/player/options.js +20 -10
  41. package/lib/commonjs/features/player/options.js.map +1 -1
  42. package/lib/commonjs/features/player/setup.js +34 -38
  43. package/lib/commonjs/features/player/setup.js.map +1 -1
  44. package/lib/commonjs/features/queue/activeTrack.js +0 -1
  45. package/lib/commonjs/features/queue/activeTrack.js.map +1 -1
  46. package/lib/commonjs/features/queue/queue.js +48 -20
  47. package/lib/commonjs/features/queue/queue.js.map +1 -1
  48. package/lib/commonjs/features/queue/repeatMode.js +2 -1
  49. package/lib/commonjs/features/queue/repeatMode.js.map +1 -1
  50. package/lib/commonjs/features/queue/shuffle.js +0 -1
  51. package/lib/commonjs/features/queue/shuffle.js.map +1 -1
  52. package/lib/commonjs/features/remoteControls.js +59 -35
  53. package/lib/commonjs/features/remoteControls.js.map +1 -1
  54. package/lib/commonjs/features/sleepTimer.js +15 -6
  55. package/lib/commonjs/features/sleepTimer.js.map +1 -1
  56. package/lib/commonjs/utils/LazyNativeEmitter.js +6 -9
  57. package/lib/commonjs/utils/LazyNativeEmitter.js.map +1 -1
  58. package/lib/commonjs/utils/NativeUpdatedValue.js +13 -12
  59. package/lib/commonjs/utils/NativeUpdatedValue.js.map +1 -1
  60. package/lib/commonjs/utils/getTrackIdentity.js +6 -4
  61. package/lib/commonjs/utils/getTrackIdentity.js.map +1 -1
  62. package/lib/commonjs/utils/useDebug.js +16 -3
  63. package/lib/commonjs/utils/useDebug.js.map +1 -1
  64. package/lib/commonjs/web/NativeAudioBrowser.js +2 -4
  65. package/lib/commonjs/web/NativeAudioBrowser.js.map +1 -1
  66. package/lib/commonjs/web/browser/parseSearchResponse.js +3 -4
  67. package/lib/commonjs/web/browser/parseSearchResponse.js.map +1 -1
  68. package/lib/commonjs/web/browser/sections.js +1 -1
  69. package/lib/commonjs/web/util/BrowserPathHelper.js +1 -3
  70. package/lib/commonjs/web/util/BrowserPathHelper.js.map +1 -1
  71. package/lib/module/CLAUDE.md +7 -2
  72. package/lib/module/features/battery.js +16 -12
  73. package/lib/module/features/battery.js.map +1 -1
  74. package/lib/module/features/browser-config.js +1 -1
  75. package/lib/module/features/browser.js +74 -24
  76. package/lib/module/features/browser.js.map +1 -1
  77. package/lib/module/features/carConnection.js +3 -4
  78. package/lib/module/features/carConnection.js.map +1 -1
  79. package/lib/module/features/equalizer.js +9 -5
  80. package/lib/module/features/equalizer.js.map +1 -1
  81. package/lib/module/features/errors.js +35 -21
  82. package/lib/module/features/errors.js.map +1 -1
  83. package/lib/module/features/favorites.js +15 -13
  84. package/lib/module/features/favorites.js.map +1 -1
  85. package/lib/module/features/gate.js +12 -6
  86. package/lib/module/features/gate.js.map +1 -1
  87. package/lib/module/features/metadata.js +16 -14
  88. package/lib/module/features/metadata.js.map +1 -1
  89. package/lib/module/features/network.js +5 -1
  90. package/lib/module/features/network.js.map +1 -1
  91. package/lib/module/features/nowPlaying.js +28 -14
  92. package/lib/module/features/nowPlaying.js.map +1 -1
  93. package/lib/module/features/output.js +8 -4
  94. package/lib/module/features/output.js.map +1 -1
  95. package/lib/module/features/playback/controls.js +10 -5
  96. package/lib/module/features/playback/controls.js.map +1 -1
  97. package/lib/module/features/playback/playWhenReady.js +6 -5
  98. package/lib/module/features/playback/playWhenReady.js.map +1 -1
  99. package/lib/module/features/playback/playing.js +5 -3
  100. package/lib/module/features/playback/playing.js.map +1 -1
  101. package/lib/module/features/playback/progress.js +11 -5
  102. package/lib/module/features/playback/progress.js.map +1 -1
  103. package/lib/module/features/playback/state.js +3 -3
  104. package/lib/module/features/playback/state.js.map +1 -1
  105. package/lib/module/features/playback/trackPlaybackTime.js +6 -1
  106. package/lib/module/features/playback/trackPlaybackTime.js.map +1 -1
  107. package/lib/module/features/playback/volume.js +6 -5
  108. package/lib/module/features/playback/volume.js.map +1 -1
  109. package/lib/module/features/player/options.js +20 -10
  110. package/lib/module/features/player/options.js.map +1 -1
  111. package/lib/module/features/player/setup.js +34 -38
  112. package/lib/module/features/player/setup.js.map +1 -1
  113. package/lib/module/features/queue/activeTrack.js +0 -1
  114. package/lib/module/features/queue/activeTrack.js.map +1 -1
  115. package/lib/module/features/queue/queue.js +48 -20
  116. package/lib/module/features/queue/queue.js.map +1 -1
  117. package/lib/module/features/queue/repeatMode.js +2 -1
  118. package/lib/module/features/queue/repeatMode.js.map +1 -1
  119. package/lib/module/features/queue/shuffle.js +0 -1
  120. package/lib/module/features/queue/shuffle.js.map +1 -1
  121. package/lib/module/features/remoteControls.js +59 -35
  122. package/lib/module/features/remoteControls.js.map +1 -1
  123. package/lib/module/features/sleepTimer.js +15 -6
  124. package/lib/module/features/sleepTimer.js.map +1 -1
  125. package/lib/module/utils/LazyNativeEmitter.js +6 -9
  126. package/lib/module/utils/LazyNativeEmitter.js.map +1 -1
  127. package/lib/module/utils/NativeUpdatedValue.js +13 -12
  128. package/lib/module/utils/NativeUpdatedValue.js.map +1 -1
  129. package/lib/module/utils/getTrackIdentity.js +6 -4
  130. package/lib/module/utils/getTrackIdentity.js.map +1 -1
  131. package/lib/module/utils/useDebug.js +16 -3
  132. package/lib/module/utils/useDebug.js.map +1 -1
  133. package/lib/module/web/NativeAudioBrowser.js +2 -4
  134. package/lib/module/web/NativeAudioBrowser.js.map +1 -1
  135. package/lib/module/web/browser/parseSearchResponse.js +3 -4
  136. package/lib/module/web/browser/parseSearchResponse.js.map +1 -1
  137. package/lib/module/web/browser/sections.js +1 -1
  138. package/lib/module/web/util/BrowserPathHelper.js +1 -3
  139. package/lib/module/web/util/BrowserPathHelper.js.map +1 -1
  140. package/lib/typescript/src/features/battery.d.ts +17 -12
  141. package/lib/typescript/src/features/battery.d.ts.map +1 -1
  142. package/lib/typescript/src/features/browser.d.ts +64 -24
  143. package/lib/typescript/src/features/browser.d.ts.map +1 -1
  144. package/lib/typescript/src/features/carConnection.d.ts +3 -4
  145. package/lib/typescript/src/features/carConnection.d.ts.map +1 -1
  146. package/lib/typescript/src/features/equalizer.d.ts +9 -5
  147. package/lib/typescript/src/features/equalizer.d.ts.map +1 -1
  148. package/lib/typescript/src/features/errors.d.ts +37 -22
  149. package/lib/typescript/src/features/errors.d.ts.map +1 -1
  150. package/lib/typescript/src/features/favorites.d.ts +15 -13
  151. package/lib/typescript/src/features/favorites.d.ts.map +1 -1
  152. package/lib/typescript/src/features/gate.d.ts +14 -8
  153. package/lib/typescript/src/features/gate.d.ts.map +1 -1
  154. package/lib/typescript/src/features/metadata.d.ts +37 -17
  155. package/lib/typescript/src/features/metadata.d.ts.map +1 -1
  156. package/lib/typescript/src/features/network.d.ts +5 -1
  157. package/lib/typescript/src/features/network.d.ts.map +1 -1
  158. package/lib/typescript/src/features/nowPlaying.d.ts +28 -14
  159. package/lib/typescript/src/features/nowPlaying.d.ts.map +1 -1
  160. package/lib/typescript/src/features/output.d.ts +8 -4
  161. package/lib/typescript/src/features/output.d.ts.map +1 -1
  162. package/lib/typescript/src/features/playback/controls.d.ts +10 -5
  163. package/lib/typescript/src/features/playback/controls.d.ts.map +1 -1
  164. package/lib/typescript/src/features/playback/playWhenReady.d.ts +6 -5
  165. package/lib/typescript/src/features/playback/playWhenReady.d.ts.map +1 -1
  166. package/lib/typescript/src/features/playback/playing.d.ts +16 -3
  167. package/lib/typescript/src/features/playback/playing.d.ts.map +1 -1
  168. package/lib/typescript/src/features/playback/progress.d.ts +11 -5
  169. package/lib/typescript/src/features/playback/progress.d.ts.map +1 -1
  170. package/lib/typescript/src/features/playback/state.d.ts +8 -3
  171. package/lib/typescript/src/features/playback/state.d.ts.map +1 -1
  172. package/lib/typescript/src/features/playback/trackPlaybackTime.d.ts +9 -2
  173. package/lib/typescript/src/features/playback/trackPlaybackTime.d.ts.map +1 -1
  174. package/lib/typescript/src/features/playback/volume.d.ts +6 -5
  175. package/lib/typescript/src/features/playback/volume.d.ts.map +1 -1
  176. package/lib/typescript/src/features/player/options.d.ts +52 -37
  177. package/lib/typescript/src/features/player/options.d.ts.map +1 -1
  178. package/lib/typescript/src/features/player/setup.d.ts +65 -60
  179. package/lib/typescript/src/features/player/setup.d.ts.map +1 -1
  180. package/lib/typescript/src/features/queue/activeTrack.d.ts +0 -1
  181. package/lib/typescript/src/features/queue/activeTrack.d.ts.map +1 -1
  182. package/lib/typescript/src/features/queue/queue.d.ts +48 -20
  183. package/lib/typescript/src/features/queue/queue.d.ts.map +1 -1
  184. package/lib/typescript/src/features/queue/repeatMode.d.ts +1 -1
  185. package/lib/typescript/src/features/queue/repeatMode.d.ts.map +1 -1
  186. package/lib/typescript/src/features/queue/shuffle.d.ts +0 -1
  187. package/lib/typescript/src/features/queue/shuffle.d.ts.map +1 -1
  188. package/lib/typescript/src/features/remoteControls.d.ts +58 -25
  189. package/lib/typescript/src/features/remoteControls.d.ts.map +1 -1
  190. package/lib/typescript/src/features/sleepTimer.d.ts +15 -7
  191. package/lib/typescript/src/features/sleepTimer.d.ts.map +1 -1
  192. package/lib/typescript/src/types/browser-nodes.d.ts +54 -57
  193. package/lib/typescript/src/types/browser-nodes.d.ts.map +1 -1
  194. package/lib/typescript/src/types/browser.d.ts +181 -144
  195. package/lib/typescript/src/types/browser.d.ts.map +1 -1
  196. package/lib/typescript/src/utils/LazyNativeEmitter.d.ts +6 -9
  197. package/lib/typescript/src/utils/LazyNativeEmitter.d.ts.map +1 -1
  198. package/lib/typescript/src/utils/NativeUpdatedValue.d.ts +13 -12
  199. package/lib/typescript/src/utils/NativeUpdatedValue.d.ts.map +1 -1
  200. package/lib/typescript/src/utils/getTrackIdentity.d.ts +6 -4
  201. package/lib/typescript/src/utils/getTrackIdentity.d.ts.map +1 -1
  202. package/lib/typescript/src/utils/useDebug.d.ts +16 -3
  203. package/lib/typescript/src/utils/useDebug.d.ts.map +1 -1
  204. package/package.json +1 -1
  205. package/src/CLAUDE.md +7 -2
  206. package/src/docs-floors.test.ts +71 -0
  207. package/src/features/battery.ts +17 -13
  208. package/src/features/browser-config.ts +1 -1
  209. package/src/features/browser.ts +65 -24
  210. package/src/features/carConnection.ts +3 -4
  211. package/src/features/equalizer.ts +9 -5
  212. package/src/features/errors.ts +37 -22
  213. package/src/features/favorites.ts +15 -13
  214. package/src/features/gate.ts +14 -8
  215. package/src/features/metadata.ts +37 -17
  216. package/src/features/network.ts +5 -1
  217. package/src/features/nowPlaying.ts +28 -14
  218. package/src/features/output.ts +8 -4
  219. package/src/features/playback/controls.ts +10 -5
  220. package/src/features/playback/playWhenReady.ts +6 -5
  221. package/src/features/playback/playing.ts +16 -3
  222. package/src/features/playback/progress.ts +11 -5
  223. package/src/features/playback/state.ts +8 -3
  224. package/src/features/playback/trackPlaybackTime.ts +9 -2
  225. package/src/features/playback/volume.ts +6 -5
  226. package/src/features/player/options.ts +54 -43
  227. package/src/features/player/setup.ts +67 -61
  228. package/src/features/queue/activeTrack.ts +0 -1
  229. package/src/features/queue/queue.ts +48 -20
  230. package/src/features/queue/repeatMode.ts +1 -1
  231. package/src/features/queue/shuffle.ts +0 -1
  232. package/src/features/remoteControls.ts +59 -35
  233. package/src/features/sleepTimer.ts +15 -7
  234. package/src/types/browser-nodes.ts +54 -57
  235. package/src/types/browser.ts +183 -146
  236. package/src/utils/LazyNativeEmitter.ts +6 -9
  237. package/src/utils/NativeUpdatedValue.ts +13 -12
  238. package/src/utils/getTrackIdentity.ts +6 -4
  239. package/src/utils/useDebug.ts +16 -3
  240. package/src/web/NativeAudioBrowser.ts +2 -4
  241. package/src/web/browser/parseSearchResponse.ts +3 -4
  242. package/src/web/browser/sections.ts +1 -1
  243. package/src/web/util/BrowserPathHelper.ts +1 -3
  244. package/website/guide/android-auto.md +25 -13
  245. package/website/guide/android-certificates.md +199 -120
  246. package/website/guide/artwork.md +93 -48
  247. package/website/guide/audio-output.md +86 -68
  248. package/website/guide/automotive.md +15 -10
  249. package/website/guide/basic-usage.md +5 -2
  250. package/website/guide/battery.md +50 -23
  251. package/website/guide/browser.md +155 -68
  252. package/website/guide/carplay.md +132 -49
  253. package/website/guide/configuration.md +85 -49
  254. package/website/guide/equalizer.md +36 -32
  255. package/website/guide/errors.md +106 -64
  256. package/website/guide/favorites.md +41 -31
  257. package/website/guide/gate.md +24 -10
  258. package/website/guide/getting-started.md +55 -2
  259. package/website/guide/hooks.md +53 -47
  260. package/website/guide/live-streams.md +80 -49
  261. package/website/guide/metadata.md +87 -53
  262. package/website/guide/migrating-from-track-player.md +94 -49
  263. package/website/guide/native-callback-fetch.md +46 -36
  264. package/website/guide/network.md +36 -20
  265. package/website/guide/now-playing.md +72 -44
  266. package/website/guide/playback.md +112 -35
  267. package/website/guide/queue.md +77 -43
  268. package/website/guide/remote-controls.md +87 -29
  269. package/website/guide/search.md +37 -22
  270. package/website/guide/sleep-timer.md +35 -14
  271. package/website/guide/track.md +59 -35
@@ -18,9 +18,10 @@ var _useNativeUpdatedValue = require("../utils/useNativeUpdatedValue");
18
18
  /**
19
19
  * Normalized, cross-platform classification of a playback failure.
20
20
  *
21
- * Both platforms map their native failure onto this set, so consumers can
22
- * branch on it without knowing whether the error came from AVFoundation or
23
- * ExoPlayer. Use this — not `code` — for anything user-visible.
21
+ * Every platform (AVFoundation on iOS, ExoPlayer on Android, Shaka on web)
22
+ * maps its native failure onto this set, so consumers can branch on it without
23
+ * knowing where the error came from. Use this — not `code` — for anything
24
+ * user-visible.
24
25
  *
25
26
  * - `'offline'` - The device had no network connection at the moment of
26
27
  * failure. The stream itself may be fine.
@@ -28,16 +29,21 @@ var _useNativeUpdatedValue = require("../utils/useNativeUpdatedValue");
28
29
  * connection refused, timed out, or the connection dropped while loading.
29
30
  * - `'not-found'` - The server said this stream is gone (HTTP 404 / 410).
30
31
  * Retrying will not help; the station is dead.
31
- * - `'rejected'` - The server refused the request (HTTP 401 / 403), e.g.
32
- * geo-blocking or an expired token.
32
+ * - `'rejected'` - The server refused the request: any HTTP 4xx other than
33
+ * 404 / 410 (auth, geo-blocking, rate limiting), a DRM or licence refusal
34
+ * (Android and web), or a region, account or parental-control refusal
35
+ * (Android).
33
36
  * - `'server-error'` - The server responded with 5xx. Usually transient.
34
- * - `'unplayable'` - The stream was fetched but cannot be played: unknown
35
- * container, unsupported codec, or a decoder failure.
37
+ * - `'unplayable'` - The stream cannot be played: an invalid source URL, a
38
+ * blocked cleartext URL (Android), an unknown container, an unsupported
39
+ * codec, or a decoder failure.
36
40
  * - `'stalled'` - Playback had started and then stopped, and the player
37
41
  * exhausted its recovery budget without recovering.
38
42
  * - `'unknown'` - The failure could not be classified. Inspect `code`.
39
43
  */
40
44
 
45
+ /** A classified playback failure: branch on `kind`, log `code`. */
46
+
41
47
  /**
42
48
  * Emitted when a playback error occurs.
43
49
  *
@@ -59,11 +65,15 @@ var _useNativeUpdatedValue = require("../utils/useNativeUpdatedValue");
59
65
  * Use this for business logic errors like authentication failures or subscription requirements.
60
66
  * - `'unknown-error'` - An unexpected error occurred (e.g., invalid configuration).
61
67
  * - `'empty-content'` - The path resolved successfully but the container has no children (e.g. an
62
- * empty Favorites tab, a search with no results).
68
+ * empty Favorites tab, a search with no results). Reaches only the `formatNavigationError`
69
+ * callback, for car-surface copy, never `useNavigationError`.
63
70
  * - `'timeout'` - The resolve did not complete within the allotted time (a stalled request or
64
- * unresponsive bridge). Surfaced on External surfaces that render their own browse list.
71
+ * unresponsive bridge). CarPlay only, and like `'empty-content'` it reaches only the
72
+ * `formatNavigationError` callback, never `useNavigationError`.
65
73
  */
66
74
 
75
+ /** A failed browse or search resolve. */
76
+
67
77
  /**
68
78
  * Emitted when a navigation error occurs.
69
79
  */
@@ -81,9 +91,9 @@ function getPlaybackError() {
81
91
  // MARK: - Event Callbacks
82
92
 
83
93
  /**
84
- * Subscribes to playback error events.
85
- * @param callback - Called when a playback error occurs
86
- * @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
94
+ * Emits when the playback error is set or cleared (`error` is `undefined`
95
+ * when it clears). Subscribe with `addListener`, which returns the
96
+ * unsubscribe function.
87
97
  */
88
98
  const onPlaybackError = exports.onPlaybackError = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onPlaybackError = cb);
89
99
 
@@ -109,9 +119,9 @@ function getNavigationError() {
109
119
  }
110
120
 
111
121
  /**
112
- * Subscribes to navigation error events.
113
- * @param callback - Called when a navigation error occurs
114
- * @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
122
+ * Emits when the navigation error is set or cleared (`error` is `undefined`
123
+ * when it clears). Subscribe with `addListener`, which returns the
124
+ * unsubscribe function.
115
125
  */
116
126
  const onNavigationError = exports.onNavigationError = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onNavigationError = cb);
117
127
 
@@ -137,9 +147,8 @@ function getFormattedNavigationError() {
137
147
  }
138
148
 
139
149
  /**
140
- * Subscribes to formatted navigation error changes.
141
- * @param callback - Called when the formatted navigation error changes
142
- * @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
150
+ * Emits each time the formatted navigation error changes. Subscribe with
151
+ * `addListener`, which returns the unsubscribe function.
143
152
  */
144
153
  const onFormattedNavigationError = exports.onFormattedNavigationError = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onFormattedNavigationError = cb);
145
154
 
@@ -147,10 +156,15 @@ const onFormattedNavigationError = exports.onFormattedNavigationError = _NativeU
147
156
  * Hook that returns the current navigation error formatted for display.
148
157
  *
149
158
  * Native formats the error using the `formatNavigationError` callback configured
150
- * in `BrowserConfiguration`, or falls back to default English messages.
159
+ * in `BrowserConfiguration`, or falls back to built-in English titles with the
160
+ * error's own message. An HTTP error's title is its status text,
161
+ * system-localized on iOS; on Android an English name for common codes. It is
162
+ * `Server Error` when there is no status code, for codes Android does not
163
+ * name, and always on web.
151
164
  *
152
- * The same formatted error is used by CarPlay and Android Auto error dialogs,
153
- * ensuring consistent error presentation across your app and external controllers.
165
+ * CarPlay and Android Auto format their own browse errors with the same
166
+ * `formatNavigationError` callback, so the copy matches across your app and
167
+ * the car.
154
168
  *
155
169
  * @returns Formatted error with title and message, or undefined if no error
156
170
  *
@@ -1 +1 @@
1
- {"version":3,"names":["_native","require","_NativeUpdatedValue","_useNativeUpdatedValue","getPlaybackError","nativeBrowser","onPlaybackError","exports","NativeUpdatedValue","emitterize","cb","usePlaybackError","useNativeUpdatedValue","getNavigationError","error","undefined","onNavigationError","useNavigationError","getFormattedNavigationError","onFormattedNavigationError","useFormattedNavigationError"],"sourceRoot":"../../../src","sources":["features/errors.ts"],"mappings":";;;;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAEA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAuCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA;AACA;AACA;;AAKA;;AAEA;AACA;AACA;AACA;AACO,SAASG,gBAAgBA,CAAA,EAA8B;EAC5D,OAAOC,qBAAa,CAACD,gBAAgB,CAAC,CAAC;AACzC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAME,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAC1BE,sCAAkB,CAACC,UAAU,CAC1BC,EAAE,IAAML,qBAAa,CAACC,eAAe,GAAGI,EAC3C,CAAC;;AAEH;;AAEA;AACA;AACA;AACA;AACO,SAASC,gBAAgBA,CAAA,EAA8B;EAC5D,OAAO,IAAAC,4CAAqB,EAACR,gBAAgB,EAAEE,eAAe,EAAE,OAAO,CAAC;AAC1E;;AAEA;;AAEA;AACA;AACA;AACA;AACO,SAASO,kBAAkBA,CAAA,EAAgC;EAChE,MAAMC,KAAK,GAAGT,qBAAa,CAACQ,kBAAkB,CAAC,CAAC;EAChD,OAAOC,KAAK,IAAIC,SAAS;AAC3B;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMC,iBAAiB,GAAAT,OAAA,CAAAS,iBAAA,GAC5BR,sCAAkB,CAACC,UAAU,CAC1BC,EAAE,IAAML,qBAAa,CAACW,iBAAiB,GAAGN,EAC7C,CAAC;;AAEH;AACA;AACA;AACA;AACO,SAASO,kBAAkBA,CAAA,EAAgC;EAChE,OAAO,IAAAL,4CAAqB,EAACC,kBAAkB,EAAEG,iBAAiB,EAAE,OAAO,CAAC;AAC9E;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,2BAA2BA,CAAA,EAE7B;EACZ,OAAOb,qBAAa,CAACa,2BAA2B,CAAC,CAAC,IAAIH,SAAS;AACjE;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMI,0BAA0B,GAAAZ,OAAA,CAAAY,0BAAA,GAAGX,sCAAkB,CAACC,UAAU,CAEpEC,EAAE,IAAML,qBAAa,CAACc,0BAA0B,GAAGT,EAAG,CAAC;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASU,2BAA2BA,CAAA,EAE7B;EACZ,OAAO,IAAAR,4CAAqB,EAC1BM,2BAA2B,EAC3BC,0BACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["_native","require","_NativeUpdatedValue","_useNativeUpdatedValue","getPlaybackError","nativeBrowser","onPlaybackError","exports","NativeUpdatedValue","emitterize","cb","usePlaybackError","useNativeUpdatedValue","getNavigationError","error","undefined","onNavigationError","useNavigationError","getFormattedNavigationError","onFormattedNavigationError","useFormattedNavigationError"],"sourceRoot":"../../../src","sources":["features/errors.ts"],"mappings":";;;;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAEA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;;AA+BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;;AAWA;AACA;AACA;;AAKA;;AAEA;AACA;AACA;AACA;AACO,SAASG,gBAAgBA,CAAA,EAA8B;EAC5D,OAAOC,qBAAa,CAACD,gBAAgB,CAAC,CAAC;AACzC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAME,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAC1BE,sCAAkB,CAACC,UAAU,CAC1BC,EAAE,IAAML,qBAAa,CAACC,eAAe,GAAGI,EAC3C,CAAC;;AAEH;;AAEA;AACA;AACA;AACA;AACO,SAASC,gBAAgBA,CAAA,EAA8B;EAC5D,OAAO,IAAAC,4CAAqB,EAACR,gBAAgB,EAAEE,eAAe,EAAE,OAAO,CAAC;AAC1E;;AAEA;;AAEA;AACA;AACA;AACA;AACO,SAASO,kBAAkBA,CAAA,EAAgC;EAChE,MAAMC,KAAK,GAAGT,qBAAa,CAACQ,kBAAkB,CAAC,CAAC;EAChD,OAAOC,KAAK,IAAIC,SAAS;AAC3B;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMC,iBAAiB,GAAAT,OAAA,CAAAS,iBAAA,GAC5BR,sCAAkB,CAACC,UAAU,CAC1BC,EAAE,IAAML,qBAAa,CAACW,iBAAiB,GAAGN,EAC7C,CAAC;;AAEH;AACA;AACA;AACA;AACO,SAASO,kBAAkBA,CAAA,EAAgC;EAChE,OAAO,IAAAL,4CAAqB,EAACC,kBAAkB,EAAEG,iBAAiB,EAAE,OAAO,CAAC;AAC9E;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,2BAA2BA,CAAA,EAE7B;EACZ,OAAOb,qBAAa,CAACa,2BAA2B,CAAC,CAAC,IAAIH,SAAS;AACjE;;AAEA;AACA;AACA;AACA;AACO,MAAMI,0BAA0B,GAAAZ,OAAA,CAAAY,0BAAA,GAAGX,sCAAkB,CAACC,UAAU,CAEpEC,EAAE,IAAML,qBAAa,CAACc,0BAA0B,GAAGT,EAAG,CAAC;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASU,2BAA2BA,CAAA,EAE7B;EACZ,OAAO,IAAAR,4CAAqB,EAC1BM,2BAA2B,EAC3BC,0BACF,CAAC;AACH","ignoreList":[]}
@@ -12,12 +12,12 @@ var _NativeUpdatedValue = require("../utils/NativeUpdatedValue");
12
12
  // MARK: - Setters
13
13
 
14
14
  /**
15
- * Sets the favorited state of the currently playing track.
16
- * Updates the heart icon in media controllers (notification, Android Auto).
15
+ * Sets the favorited state of the Active Track.
16
+ * Updates the heart icon in media controllers (notification, Android Auto, CarPlay).
17
17
  *
18
- * Use this for programmatic favorite changes (e.g., from a favorite button in your app).
19
- * For heart button taps from media controllers, use `onFavoriteChanged` instead -
20
- * the native side handles those automatically.
18
+ * Use this for favorite changes from your app, such as a favorite button.
19
+ * It emits `onFavoriteChanged`, so persist the change there, not again in your
20
+ * button handler.
21
21
  *
22
22
  * @param favorited - Whether the track is favorited
23
23
  *
@@ -31,7 +31,7 @@ function setActiveTrackFavorited(favorited) {
31
31
  }
32
32
 
33
33
  /**
34
- * Toggles the favorited state of the currently playing track.
34
+ * Toggles the favorited state of the Active Track. Emits `onFavoriteChanged`.
35
35
  *
36
36
  * @example
37
37
  * ```ts
@@ -76,16 +76,18 @@ function setFavorites(favorites) {
76
76
  // MARK: - Event Callbacks
77
77
 
78
78
  /**
79
- * Event data for when the favorite state of the active track changes.
80
- * Emitted when the user taps the heart button in a media controller (notification, Android Auto, CarPlay).
79
+ * Event data for when the favorite state of the Active Track changes.
80
+ * Emitted on every change: a heart tap in a media controller (notification,
81
+ * Android Auto, CarPlay), a Siri request (iOS), `setActiveTrackFavorited` or
82
+ * `toggleActiveTrackFavorited`.
81
83
  */
82
84
 
83
85
  /**
84
- * Subscribes to favorite state change events.
85
- * Called when the user taps the heart button in a media controller.
86
- * The native side has already updated the track's favorite state and UI.
87
- *
88
- * @param callback - Called with the track and its new favorite state
86
+ * Subscribes to favorite changes of the Active Track, with the track and its
87
+ * new favorite state. Fires on every change: a heart tap in a media controller,
88
+ * a Siri request (iOS), `setActiveTrackFavorited` or
89
+ * `toggleActiveTrackFavorited`. Persist favorites here, in one place. The
90
+ * native side has already updated the track's favorite state and UI.
89
91
  * @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
90
92
  *
91
93
  * @example
@@ -1 +1 @@
1
- {"version":3,"names":["_native","require","_NativeUpdatedValue","setActiveTrackFavorited","favorited","nativeBrowser","toggleActiveTrackFavorited","setFavorites","favorites","onFavoriteChanged","exports","NativeUpdatedValue","emitterize","cb"],"sourceRoot":"../../../src","sources":["features/favorites.ts"],"mappings":";;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,uBAAuBA,CAACC,SAAkB,EAAQ;EAChEC,qBAAa,CAACF,uBAAuB,CAACC,SAAS,CAAC;AAClD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,0BAA0BA,CAAA,EAAS;EACjDD,qBAAa,CAACC,0BAA0B,CAAC,CAAC;AAC5C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,YAAYA,CAACC,SAAmB,EAAQ;EACtDH,qBAAa,CAACE,YAAY,CAACC,SAAS,CAAC;AACvC;;AAEA;;AAEA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAC5BE,sCAAkB,CAACC,UAAU,CAC1BC,EAAE,IAAMR,qBAAa,CAACI,iBAAiB,GAAGI,EAC7C,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_native","require","_NativeUpdatedValue","setActiveTrackFavorited","favorited","nativeBrowser","toggleActiveTrackFavorited","setFavorites","favorites","onFavoriteChanged","exports","NativeUpdatedValue","emitterize","cb"],"sourceRoot":"../../../src","sources":["features/favorites.ts"],"mappings":";;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,uBAAuBA,CAACC,SAAkB,EAAQ;EAChEC,qBAAa,CAACF,uBAAuB,CAACC,SAAS,CAAC;AAClD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,0BAA0BA,CAAA,EAAS;EACjDD,qBAAa,CAACC,0BAA0B,CAAC,CAAC;AAC5C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,YAAYA,CAACC,SAAmB,EAAQ;EACtDH,qBAAa,CAACE,YAAY,CAACC,SAAS,CAAC;AACvC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAC5BE,sCAAkB,CAACC,UAAU,CAC1BC,EAAE,IAAMR,qBAAa,CAACI,iBAAiB,GAAGI,EAC7C,CAAC","ignoreList":[]}
@@ -37,12 +37,15 @@ var _LazyNativeEmitter = require("../utils/LazyNativeEmitter");
37
37
  /**
38
38
  * A gate's chrome (title and optional message).
39
39
  *
40
- * While the gate is active, every browse or search request on car surfaces
41
- * (CarPlay, Android Auto) shows this page instead of the real content.
42
- * Playback, the queue, and now-playing are unaffected.
40
+ * While the gate is up, a gated browse or search on CarPlay or Android Auto
41
+ * shows this page instead of the content, and a gated voice search (Siri on
42
+ * iOS, Google Assistant on Android, including from the phone) is refused.
43
+ * Playback and the queue are unaffected.
43
44
  *
44
- * - **CarPlay**: plain centered message page.
45
- * - **Android Auto**: one non-playable list tile (message not shown).
45
+ * - **CarPlay**: plain centered message page. Now Playing keeps its transport
46
+ * controls but hides the `carPlayNowPlayingButtons`.
47
+ * - **Android Auto**: one non-playable list tile, with the title as its main
48
+ * line and the message as its subtitle.
46
49
  */
47
50
 
48
51
  /**
@@ -61,6 +64,8 @@ var _LazyNativeEmitter = require("../utils/LazyNativeEmitter");
61
64
  * - Return a {@link Gate} to gate with specific chrome for this request.
62
65
  * - Return `true` to gate using the default chrome (or the built-in fallback).
63
66
  * - Return `false` to allow the request through.
67
+ * - If the resolver throws, the request is gated (fails closed): only `false`
68
+ * lets a request through.
64
69
  */
65
70
 
66
71
  // MARK: - Internal state
@@ -142,7 +147,8 @@ function setGate(a, b) {
142
147
  }
143
148
 
144
149
  /**
145
- * Drops the gate — the real content comes back, and the current tab is kept.
150
+ * Drops the gate — the real content comes back. Android Auto keeps the current
151
+ * tab; CarPlay rebuilds its tab bar on the first tab.
146
152
  *
147
153
  * @platform ios android
148
154
  * A no-op on web, where no gate was ever raised.
@@ -1 +1 @@
1
- {"version":3,"names":["_native","require","_LazyNativeEmitter","resolver","toPublicRequest","req","reason","kind","path","params","search","_exhaustive","Error","String","nativeBrowser","resolveGate","result","gated","gate","setGate","a","b","undefined","clearGate","onGate","exports","LazyNativeEmitter","emitterize","cb"],"sourceRoot":"../../../src","sources":["features/gate.ts"],"mappings":";;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAEA;;AAEA;;AAGA;AACA;AACA;AACA;AACA;;AAOA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;;AAGA;;AAEA,IAAIE,QAAkC;AAEtC,SAASC,eAAeA,CAACC,GAAsB,EAAe;EAC5D,QAAQA,GAAG,CAACC,MAAM;IAChB,KAAK,QAAQ;MACX,OAAO;QAAEC,IAAI,EAAE,QAAQ;QAAEC,IAAI,EAAEH,GAAG,CAACG,IAAI,IAAI;MAAG,CAAC;IACjD,KAAK,QAAQ;MACX;MACA;MACA;MACA;MACA,OAAO;QAAED,IAAI,EAAE,QAAQ;QAAEE,MAAM,EAAEJ,GAAG,CAACK;MAAQ,CAAC;IAChD;MAAS;QACP,MAAMC,WAAkB,GAAGN,GAAG,CAACC,MAAM;QACrC,MAAM,IAAIM,KAAK,CAAC,yBAAyBC,MAAM,CAACF,WAAW,CAAC,EAAE,CAAC;MACjE;EACF;AACF;;AAEA;AACA;AACAG,qBAAa,CAACC,WAAW,GAAG,MAC1BV,GAAsB,IACI;EAC1B,MAAMW,MAAM,GAAGb,QAAQ,GAAGA,QAAQ,CAACC,eAAe,CAACC,GAAG,CAAC,CAAC,GAAG,IAAI;EAC/D,IAAIW,MAAM,KAAK,KAAK,EAAE,OAAO;IAAEC,KAAK,EAAE;EAAM,CAAC;EAC7C,IAAID,MAAM,KAAK,IAAI,EAAE,OAAO;IAAEC,KAAK,EAAE;EAAK,CAAC;EAC3C,OAAO;IAAEA,KAAK,EAAE,IAAI;IAAEC,IAAI,EAAEF;EAAO,CAAC;AACtC,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,SAASG,OAAOA,CAACC,CAAsB,EAAEC,CAAgB,EAAQ;EACtE,IAAI,OAAOD,CAAC,KAAK,UAAU,EAAE;IAC3BjB,QAAQ,GAAGiB,CAAC;IACZN,qBAAa,CAACK,OAAO,CAACG,SAAS,EAAE,IAAI,CAAC;EACxC,CAAC,MAAM;IACLnB,QAAQ,GAAGkB,CAAC;IACZP,qBAAa,CAACK,OAAO,CAACC,CAAC,EAAEC,CAAC,IAAI,IAAI,CAAC;EACrC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,SAASA,CAAA,EAAS;EAChCpB,QAAQ,GAAGmB,SAAS;EACpBR,qBAAa,CAACS,SAAS,CAAC,CAAC;AAC3B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAGE,oCAAiB,CAACC,UAAU,CAC/CC,EAAE,IAAMd,qBAAa,CAACU,MAAM,GAAGI,EAClC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_native","require","_LazyNativeEmitter","resolver","toPublicRequest","req","reason","kind","path","params","search","_exhaustive","Error","String","nativeBrowser","resolveGate","result","gated","gate","setGate","a","b","undefined","clearGate","onGate","exports","LazyNativeEmitter","emitterize","cb"],"sourceRoot":"../../../src","sources":["features/gate.ts"],"mappings":";;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAEA;;AAEA;;AAGA;AACA;AACA;AACA;AACA;;AAOA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;;AAEA,IAAIE,QAAkC;AAEtC,SAASC,eAAeA,CAACC,GAAsB,EAAe;EAC5D,QAAQA,GAAG,CAACC,MAAM;IAChB,KAAK,QAAQ;MACX,OAAO;QAAEC,IAAI,EAAE,QAAQ;QAAEC,IAAI,EAAEH,GAAG,CAACG,IAAI,IAAI;MAAG,CAAC;IACjD,KAAK,QAAQ;MACX;MACA;MACA;MACA;MACA,OAAO;QAAED,IAAI,EAAE,QAAQ;QAAEE,MAAM,EAAEJ,GAAG,CAACK;MAAQ,CAAC;IAChD;MAAS;QACP,MAAMC,WAAkB,GAAGN,GAAG,CAACC,MAAM;QACrC,MAAM,IAAIM,KAAK,CAAC,yBAAyBC,MAAM,CAACF,WAAW,CAAC,EAAE,CAAC;MACjE;EACF;AACF;;AAEA;AACA;AACAG,qBAAa,CAACC,WAAW,GAAG,MAC1BV,GAAsB,IACI;EAC1B,MAAMW,MAAM,GAAGb,QAAQ,GAAGA,QAAQ,CAACC,eAAe,CAACC,GAAG,CAAC,CAAC,GAAG,IAAI;EAC/D,IAAIW,MAAM,KAAK,KAAK,EAAE,OAAO;IAAEC,KAAK,EAAE;EAAM,CAAC;EAC7C,IAAID,MAAM,KAAK,IAAI,EAAE,OAAO;IAAEC,KAAK,EAAE;EAAK,CAAC;EAC3C,OAAO;IAAEA,KAAK,EAAE,IAAI;IAAEC,IAAI,EAAEF;EAAO,CAAC;AACtC,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,SAASG,OAAOA,CAACC,CAAsB,EAAEC,CAAgB,EAAQ;EACtE,IAAI,OAAOD,CAAC,KAAK,UAAU,EAAE;IAC3BjB,QAAQ,GAAGiB,CAAC;IACZN,qBAAa,CAACK,OAAO,CAACG,SAAS,EAAE,IAAI,CAAC;EACxC,CAAC,MAAM;IACLnB,QAAQ,GAAGkB,CAAC;IACZP,qBAAa,CAACK,OAAO,CAACC,CAAC,EAAEC,CAAC,IAAI,IAAI,CAAC;EACrC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,SAASA,CAAA,EAAS;EAChCpB,QAAQ,GAAGmB,SAAS;EACpBR,qBAAa,CAACS,SAAS,CAAC,CAAC;AAC3B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAGE,oCAAiB,CAACC,UAAU,CAC/CC,EAAE,IAAMd,qBAAa,CAACU,MAAM,GAAGI,EAClC,CAAC","ignoreList":[]}
@@ -8,20 +8,23 @@ var _native = require("../native");
8
8
  var _NativeUpdatedValue = require("../utils/NativeUpdatedValue");
9
9
  // MARK: - Types
10
10
 
11
+ /** The track fields {@link NowPlayingMetadata} carries. */
12
+
11
13
  /**
12
14
  * Metadata update for the now playing notification.
13
- * Pass to `updateNowPlaying()` to override what's shown in the notification/lock screen.
14
- * Pass `null` to clear overrides and revert to track metadata.
15
+ * Pass to `updateNowPlaying()` to override what's shown in the
16
+ * notification/lock screen; pass it `null` to clear the override.
15
17
  */
16
18
 
17
19
  /**
18
- * Timed metadata received during playback.
19
- * Contains metadata from ICY streams (radio) or ID3 frames.
20
+ * Timed metadata received during playback: ICY (radio) or ID3 frames.
21
+ * On iOS, also a file's own tags, once on load, when the file has no chapters.
20
22
  */
21
23
 
22
24
  /**
23
- * Static track metadata from the media file.
24
- * Contains standardized metadata fields.
25
+ * Static track metadata. On iOS, the media file's own tags. On Android,
26
+ * Media3's merged metadata, where the Track's fields and the now-playing lines win over
27
+ * the file's tags. `compilation` and `url` are never set.
25
28
  */
26
29
 
27
30
  /**
@@ -38,33 +41,32 @@ var _NativeUpdatedValue = require("../utils/NativeUpdatedValue");
38
41
  * Never fires on web — the web player does not read chapter markers. See
39
42
  * {@link https://github.com/radio-garden/react-native-audio-browser/issues/118 | #118}.
40
43
  *
41
- * @param callback - Called when chapter metadata is received
42
44
  * @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
43
45
  */
44
46
  const onChapterMetadata = exports.onChapterMetadata = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onChapterMetadata = cb);
45
47
 
46
48
  /**
47
- * Subscribes to track metadata events.
49
+ * Subscribes to track metadata events. On iOS it fires once on load, when the
50
+ * file has tags. On Android it fires whenever the player's merged metadata
51
+ * changes.
48
52
  *
49
53
  * @platform ios android
50
54
  * Never fires on web — the web player does not read embedded file tags. See
51
55
  * {@link https://github.com/radio-garden/react-native-audio-browser/issues/118 | #118}.
52
56
  *
53
- * @param callback - Called when static track metadata is received
54
57
  * @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
55
58
  */
56
59
  const onTrackMetadata = exports.onTrackMetadata = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onTrackMetadata = cb);
57
60
 
58
61
  /**
59
- * Subscribes to timed metadata events (ICY/ID3 from live streams).
62
+ * Subscribes to timed metadata events (ICY/ID3 from live streams). On iOS it
63
+ * also fires on load with a file's own tags when the file has no chapters.
60
64
  *
61
65
  * @platform ios android
62
- * Never fires on web. ICY metadata is stripped by the browser before the player
63
- * can see it, and no browser API exposes it; in-band ID3 from HLS is reachable
64
- * but not yet wired. See
66
+ * Never fires on web: the browser strips ICY metadata before the player sees
67
+ * it, and the web player does not read in-band ID3 from HLS. See
65
68
  * {@link https://github.com/radio-garden/react-native-audio-browser/issues/118 | #118}.
66
69
  *
67
- * @param callback - Called when stream metadata is received (title, artist from ICY/ID3 tags)
68
70
  * @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
69
71
  */
70
72
  const onTimedMetadata = exports.onTimedMetadata = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onTimedMetadata = cb);
@@ -1 +1 @@
1
- {"version":3,"names":["_native","require","_NativeUpdatedValue","onChapterMetadata","exports","NativeUpdatedValue","emitterize","cb","nativeBrowser","onTrackMetadata","onTimedMetadata"],"sourceRoot":"../../../src","sources":["features/metadata.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAEA;;AAyBA;AACA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;;AAYA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAGE,sCAAkB,CAACC,UAAU,CAE3DC,EAAE,IAAMC,qBAAa,CAACL,iBAAiB,GAAGI,EAAG,CAAC;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,eAAe,GAAAL,OAAA,CAAAK,eAAA,GAAGJ,sCAAkB,CAACC,UAAU,CACzDC,EAAE,IAAMC,qBAAa,CAACC,eAAe,GAAGF,EAC3C,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,eAAe,GAAAN,OAAA,CAAAM,eAAA,GAAGL,sCAAkB,CAACC,UAAU,CACzDC,EAAE,IAAMC,qBAAa,CAACE,eAAe,GAAGH,EAC3C,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_native","require","_NativeUpdatedValue","onChapterMetadata","exports","NativeUpdatedValue","emitterize","cb","nativeBrowser","onTrackMetadata","onTimedMetadata"],"sourceRoot":"../../../src","sources":["features/metadata.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAEA;;AAEA;;AAiCA;AACA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;;AA8BA;AACA;AACA;AACA;;AAYA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAGE,sCAAkB,CAACC,UAAU,CAE3DC,EAAE,IAAMC,qBAAa,CAACL,iBAAiB,GAAGI,EAAG,CAAC;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,eAAe,GAAAL,OAAA,CAAAK,eAAA,GAAGJ,sCAAkB,CAACC,UAAU,CACzDC,EAAE,IAAMC,qBAAa,CAACC,eAAe,GAAGF,EAC3C,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,eAAe,GAAAN,OAAA,CAAAM,eAAA,GAAGL,sCAAkB,CAACC,UAAU,CACzDC,EAAE,IAAMC,qBAAa,CAACE,eAAe,GAAGH,EAC3C,CAAC","ignoreList":[]}
@@ -13,6 +13,8 @@ var _useNativeUpdatedValue = require("../utils/useNativeUpdatedValue");
13
13
 
14
14
  /**
15
15
  * Gets the current network connectivity state.
16
+ * On Android it reads `true` before `setupPlayer` has connected the player, and
17
+ * while its service restarts.
16
18
  * @returns true if the device is online, false otherwise
17
19
  */
18
20
  function getOnline() {
@@ -23,7 +25,8 @@ function getOnline() {
23
25
 
24
26
  /**
25
27
  * Subscribes to network connectivity changes.
26
- * @param callback - Called when network state changes
28
+ * On Android it fires nothing until `setupPlayer` has connected the player, and then
29
+ * fires once with the current state.
27
30
  * @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
28
31
  */
29
32
  const onOnlineChanged = exports.onOnlineChanged = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onOnlineChanged = cb);
@@ -32,6 +35,7 @@ const onOnlineChanged = exports.onOnlineChanged = _NativeUpdatedValue.NativeUpda
32
35
 
33
36
  /**
34
37
  * Hook that returns the current network connectivity state and updates when it changes.
38
+ * On Android it reads `true` until `setupPlayer` has connected the player.
35
39
  * @returns true if the device is online, false otherwise
36
40
  */
37
41
  function useOnline() {
@@ -1 +1 @@
1
- {"version":3,"names":["_native","require","_NativeUpdatedValue","_useNativeUpdatedValue","getOnline","nativeBrowser","onOnlineChanged","exports","NativeUpdatedValue","emitterize","cb","useOnline","useNativeUpdatedValue"],"sourceRoot":"../../../src","sources":["features/network.ts"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAEA;;AAEA;AACA;AACA;AACA;AACO,SAASG,SAASA,CAAA,EAAY;EACnC,OAAOC,qBAAa,CAACD,SAAS,CAAC,CAAC;AAClC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAME,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAGE,sCAAkB,CAACC,UAAU,CACzDC,EAAE,IAAML,qBAAa,CAACC,eAAe,GAAGI,EAC3C,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACO,SAASC,SAASA,CAAA,EAAY;EACnC,OAAO,IAAAC,4CAAqB,EAACR,SAAS,EAAEE,eAAe,CAAC;AAC1D","ignoreList":[]}
1
+ {"version":3,"names":["_native","require","_NativeUpdatedValue","_useNativeUpdatedValue","getOnline","nativeBrowser","onOnlineChanged","exports","NativeUpdatedValue","emitterize","cb","useOnline","useNativeUpdatedValue"],"sourceRoot":"../../../src","sources":["features/network.ts"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,SAASA,CAAA,EAAY;EACnC,OAAOC,qBAAa,CAACD,SAAS,CAAC,CAAC;AAClC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAGE,sCAAkB,CAACC,UAAU,CACzDC,EAAE,IAAML,qBAAa,CAACC,eAAe,GAAGI,EAC3C,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,SAASA,CAAA,EAAY;EACnC,OAAO,IAAAC,4CAAqB,EAACR,SAAS,EAAEE,eAAe,CAAC;AAC1D","ignoreList":[]}
@@ -16,7 +16,11 @@ var _useNativeUpdatedValue = require("../utils/useNativeUpdatedValue");
16
16
 
17
17
  /**
18
18
  * Updates the now playing notification metadata.
19
- * Pass null/undefined to clear overrides and revert to track metadata.
19
+ *
20
+ * Lasts until you pass `null`, which clears it, or the active track changes. A `nowPlaying`
21
+ * formatter's fields win over it. With `nowPlaying: false` the iOS and
22
+ * Android surface ignores it, though `getNowPlaying` still reports it; web
23
+ * ignores `nowPlaying`.
20
24
  *
21
25
  * @example
22
26
  * ```ts
@@ -26,7 +30,7 @@ var _useNativeUpdatedValue = require("../utils/useNativeUpdatedValue");
26
30
  * artist: streamMetadata.artist,
27
31
  * })
28
32
  *
29
- * // Clear overrides, revert to track metadata
33
+ * // Clear the override
30
34
  * updateNowPlaying(null)
31
35
  * ```
32
36
  */
@@ -35,7 +39,10 @@ function updateNowPlaying(update) {
35
39
  }
36
40
 
37
41
  /**
38
- * Gets the current now playing metadata (override if set, else track metadata).
42
+ * Returns what the now-playing surface shows: flash, formatter output,
43
+ * override or track fields, in that priority. `undefined` when there is no
44
+ * active track. With `nowPlaying: false`, it returns the flash, override or
45
+ * track fields, regardless of what the surface shows.
39
46
  */
40
47
  function getNowPlaying() {
41
48
  return _native.nativeBrowser.getNowPlaying() ?? undefined;
@@ -43,15 +50,19 @@ function getNowPlaying() {
43
50
 
44
51
  /**
45
52
  * Temporarily replaces now-playing fields for `durationMs`, then reverts to
46
- * the live metadata. The flash outranks the now-playing formatter and the
47
- * `updateNowPlaying` override while active (live metadata can't stomp it),
48
- * and the revert runs on a native timer — JS timers pause in a backgrounded
49
- * host (the lock screen case) — so it fires reliably. A track change clears
50
- * the flash early; repeated calls restart the window.
53
+ * the live metadata. While active it outranks the `nowPlaying` formatter
54
+ * ({@link features/player!FormatNowPlayingCallback | FormatNowPlayingCallback}) and the `updateNowPlaying` override.
55
+ * The revert runs on a native timer, so it fires while the app is
56
+ * backgrounded. A track change clears the flash early; repeated calls
57
+ * restart the window.
58
+ *
59
+ * On web the flash is a plain `updateNowPlaying` override on a JS timer. It
60
+ * replaces any override you set, the revert clears the override instead of
61
+ * restoring it, and a track change does not cancel the timer, so the revert
62
+ * can also clear an override set for the next track. With
63
+ * `nowPlaying: false`, Android ignores the flash; iOS still shows it.
51
64
  *
52
- * The feedback channel for refused remote commands: external surfaces have
53
- * no toast primitive, so a transient metadata swap is the only way to talk
54
- * to the user there.
65
+ * See the [Now playing guide](https://audiobrowser.dev/guide/now-playing#the-flash-transient-top-priority).
55
66
  *
56
67
  * @example
57
68
  * ```ts
@@ -68,7 +79,8 @@ function flashNowPlaying(update, durationMs) {
68
79
 
69
80
  /**
70
81
  * Clears an active flash immediately, reverting to the live metadata.
71
- * No-op when no flash is active.
82
+ * No-op when no flash is active. On web it also clears the
83
+ * `updateNowPlaying` override.
72
84
  */
73
85
  function clearNowPlayingFlash() {
74
86
  _native.nativeBrowser.clearNowPlayingFlash();
@@ -78,8 +90,10 @@ function clearNowPlayingFlash() {
78
90
 
79
91
  /**
80
92
  * Subscribes to now playing metadata change events.
81
- * Fires when updateNowPlaying is called or when the track changes.
82
- * @param callback - Called when now playing metadata changes
93
+ * Fires when the now-playing lines change: track change, `updateNowPlaying`,
94
+ * a flash starting or ending, or a new formatter result. On iOS and
95
+ * Android, an update that leaves the lines unchanged does not fire; on web
96
+ * every `updateNowPlaying` call, flash start and revert fires.
83
97
  * @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
84
98
  */
85
99
  const onNowPlayingChanged = exports.onNowPlayingChanged = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onNowPlayingChanged = cb);
@@ -1 +1 @@
1
- {"version":3,"names":["_native","require","_NativeUpdatedValue","_useNativeUpdatedValue","updateNowPlaying","update","nativeBrowser","undefined","getNowPlaying","flashNowPlaying","durationMs","clearNowPlayingFlash","onNowPlayingChanged","exports","NativeUpdatedValue","emitterize","cb","useNowPlaying","useNativeUpdatedValue"],"sourceRoot":"../../../src","sources":["features/nowPlaying.ts"],"mappings":";;;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,gBAAgBA,CAACC,MAA+B,EAAQ;EACtEC,qBAAa,CAACF,gBAAgB,CAACC,MAAM,IAAIE,SAAS,CAAC;AACrD;;AAEA;AACA;AACA;AACO,SAASC,aAAaA,CAAA,EAAmC;EAC9D,OAAOF,qBAAa,CAACE,aAAa,CAAC,CAAC,IAAID,SAAS;AACnD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,eAAeA,CAC7BJ,MAAwB,EACxBK,UAAkB,EACZ;EACNJ,qBAAa,CAACG,eAAe,CAACJ,MAAM,EAAEK,UAAU,CAAC;AACnD;;AAEA;AACA;AACA;AACA;AACO,SAASC,oBAAoBA,CAAA,EAAS;EAC3CL,qBAAa,CAACK,oBAAoB,CAAC,CAAC;AACtC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAC9BE,sCAAkB,CAACC,UAAU,CAC1BC,EAAE,IAAMV,qBAAa,CAACM,mBAAmB,GAAGI,EAC/C,CAAC;;AAEH;;AAEA;AACA;AACA;AACA;AACO,SAASC,aAAaA,CAAA,EAAmC;EAC9D,OAAO,IAAAC,4CAAqB,EAACV,aAAa,EAAEI,mBAAmB,CAAC;AAClE","ignoreList":[]}
1
+ {"version":3,"names":["_native","require","_NativeUpdatedValue","_useNativeUpdatedValue","updateNowPlaying","update","nativeBrowser","undefined","getNowPlaying","flashNowPlaying","durationMs","clearNowPlayingFlash","onNowPlayingChanged","exports","NativeUpdatedValue","emitterize","cb","useNowPlaying","useNativeUpdatedValue"],"sourceRoot":"../../../src","sources":["features/nowPlaying.ts"],"mappings":";;;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,gBAAgBA,CAACC,MAA+B,EAAQ;EACtEC,qBAAa,CAACF,gBAAgB,CAACC,MAAM,IAAIE,SAAS,CAAC;AACrD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,aAAaA,CAAA,EAAmC;EAC9D,OAAOF,qBAAa,CAACE,aAAa,CAAC,CAAC,IAAID,SAAS;AACnD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,eAAeA,CAC7BJ,MAAwB,EACxBK,UAAkB,EACZ;EACNJ,qBAAa,CAACG,eAAe,CAACJ,MAAM,EAAEK,UAAU,CAAC;AACnD;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,oBAAoBA,CAAA,EAAS;EAC3CL,qBAAa,CAACK,oBAAoB,CAAC,CAAC;AACtC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAC9BE,sCAAkB,CAACC,UAAU,CAC1BC,EAAE,IAAMV,qBAAa,CAACM,mBAAmB,GAAGI,EAC/C,CAAC;;AAEH;;AAEA;AACA;AACA;AACA;AACO,SAASC,aAAaA,CAAA,EAAmC;EAC9D,OAAO,IAAAC,4CAAqB,EAACV,aAAa,EAAEI,mBAAmB,CAAC;AAClE","ignoreList":[]}
@@ -39,9 +39,11 @@ function supportsOutputSwitcher() {
39
39
 
40
40
  /**
41
41
  * The current audio output, or `undefined` when unknown. iOS reports one while a
42
- * session is active; Android reports the active output route via AudioManager
43
- * (the `type` is coarse — e.g. wired headphones may report as `speaker`), or the
44
- * remote output selected in the Output Switcher when `remoteOutputs` is on.
42
+ * session is active. Android reports the device media is routed to, from
43
+ * AudioManager, or the remote output selected in the Output Switcher when
44
+ * `remoteOutputs` is on. On Android 13+ (API 33) the route is exact and follows
45
+ * manual reroutes. Below that it is picked from the connected devices and misses
46
+ * a reroute while a device stays connected.
45
47
  * Guard for `undefined`.
46
48
  */
47
49
  function getOutput() {
@@ -52,7 +54,9 @@ function getOutput() {
52
54
 
53
55
  /**
54
56
  * Subscribes to current-output changes (headphones unplugged, Bluetooth speaker
55
- * connected, AirPlay/route selected). Fires on iOS and Android 11+; never below.
57
+ * connected, AirPlay/route selected). Fires on iOS and Android; never on web.
58
+ * On Android below 13 it cannot see a manual reroute between two connected
59
+ * devices.
56
60
  * @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
57
61
  */
58
62
  const onOutputChanged = exports.onOutputChanged = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onOutputChanged = cb);
@@ -1 +1 @@
1
- {"version":3,"names":["_native","require","_NativeUpdatedValue","_useNativeUpdatedValue","openOutputPicker","nativeBrowser","supportsOutputSwitcher","getOutput","onOutputChanged","exports","NativeUpdatedValue","emitterize","cb","useOutput","useNativeUpdatedValue"],"sourceRoot":"../../../src","sources":["features/output.ts"],"mappings":";;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAIA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,gBAAgBA,CAAA,EAAS;EACvCC,qBAAa,CAACD,gBAAgB,CAAC,CAAC;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASE,sBAAsBA,CAAA,EAAY;EAChD,OAAOD,qBAAa,CAACC,sBAAsB,CAAC,CAAC;AAC/C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,SAASA,CAAA,EAAuB;EAC9C,OAAOF,qBAAa,CAACE,SAAS,CAAC,CAAC;AAClC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMC,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAGE,sCAAkB,CAACC,UAAU,CACzDC,EAAE,IAAMP,qBAAa,CAACG,eAAe,GAAGI,EAC3C,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACO,SAASC,SAASA,CAAA,EAAuB;EAC9C,OAAO,IAAAC,4CAAqB,EAACP,SAAS,EAAEC,eAAe,CAAC;AAC1D","ignoreList":[]}
1
+ {"version":3,"names":["_native","require","_NativeUpdatedValue","_useNativeUpdatedValue","openOutputPicker","nativeBrowser","supportsOutputSwitcher","getOutput","onOutputChanged","exports","NativeUpdatedValue","emitterize","cb","useOutput","useNativeUpdatedValue"],"sourceRoot":"../../../src","sources":["features/output.ts"],"mappings":";;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAIA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,gBAAgBA,CAAA,EAAS;EACvCC,qBAAa,CAACD,gBAAgB,CAAC,CAAC;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASE,sBAAsBA,CAAA,EAAY;EAChD,OAAOD,qBAAa,CAACC,sBAAsB,CAAC,CAAC;AAC/C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,SAASA,CAAA,EAAuB;EAC9C,OAAOF,qBAAa,CAACE,SAAS,CAAC,CAAC;AAClC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAGE,sCAAkB,CAACC,UAAU,CACzDC,EAAE,IAAMP,qBAAa,CAACG,eAAe,GAAGI,EAC3C,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACO,SAASC,SAASA,CAAA,EAAuB;EAC9C,OAAO,IAAAC,4CAAqB,EAACP,SAAS,EAAEC,eAAe,CAAC;AAC1D","ignoreList":[]}
@@ -44,16 +44,20 @@ function togglePlayback() {
44
44
  }
45
45
 
46
46
  /**
47
- * Stops playback and resets position to the beginning.
48
- * The track remains loaded and can be resumed with play().
49
- * For live streams, position is not reset.
47
+ * Stops playback. The track stays current, and play() starts it again.
48
+ * iOS rewinds a non-live track to the start; Android and web keep the
49
+ * position, so play() resumes where it stopped.
50
50
  */
51
51
  function stop() {
52
52
  _native.nativeBrowser.stop();
53
53
  }
54
54
 
55
55
  /**
56
- * Retries playing the current item when the playback state is `'error'`.
56
+ * Retries playing the current item. Meant for the `'error'` state, but not
57
+ * gated on it: on iOS it reloads the current item in any state, even while
58
+ * playing. On Android and web it reloads whenever the player is stopped or
59
+ * failed, without setting the play intent, so after stop() it loads the item
60
+ * but does not play it.
57
61
  *
58
62
  * @see {@link PlaybackState}
59
63
  * @see {@link usePlayback}
@@ -74,7 +78,8 @@ function seekTo(position) {
74
78
  * Jump to the live edge of the current track; no-op unless the track
75
79
  * declares `live: true`. A stream with a seekable live window (HLS) seeks
76
80
  * to the window's edge; a non-seekable stream (e.g. ICY radio) reconnects
77
- * to rejoin live — an expired URL re-resolves through `media.resolve`.
81
+ * to rejoin live. iOS re-runs `media.resolve` on the reconnect; Android
82
+ * reuses the resolved URL and re-resolves only after it fails to open.
78
83
  */
79
84
  function seekToLiveEdge() {
80
85
  _native.nativeBrowser.seekToLiveEdge();
@@ -1 +1 @@
1
- {"version":3,"names":["_native","require","reset","nativeBrowser","play","pause","togglePlayback","stop","retry","seekTo","position","seekToLiveEdge","seekBy","offset"],"sourceRoot":"../../../../src","sources":["features/playback/controls.ts"],"mappings":";;;;;;;;;;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AAFA;;AAIA;AACA;AACA;AACO,SAASC,KAAKA,CAAA,EAAS;EAC5BC,qBAAa,CAACD,KAAK,CAAC,CAAC;AACvB;;AAEA;AACA;AACA;AACO,SAASE,IAAIA,CAAA,EAAS;EAC3BD,qBAAa,CAACC,IAAI,CAAC,CAAC;AACtB;;AAEA;AACA;AACA;AACO,SAASC,KAAKA,CAAA,EAAS;EAC5BF,qBAAa,CAACE,KAAK,CAAC,CAAC;AACvB;;AAEA;AACA;AACA;AACO,SAASC,cAAcA,CAAA,EAAS;EACrCH,qBAAa,CAACG,cAAc,CAAC,CAAC;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,IAAIA,CAAA,EAAS;EAC3BJ,qBAAa,CAACI,IAAI,CAAC,CAAC;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,KAAKA,CAAA,EAAS;EAC5BL,qBAAa,CAACK,KAAK,CAAC,CAAC;AACvB;;AAEA;AACA;AACA;AACA;AACO,SAASC,MAAMA,CAACC,QAAgB,EAAQ;EAC7CP,qBAAa,CAACM,MAAM,CAACC,QAAQ,CAAC;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAAA,EAAS;EACrCR,qBAAa,CAACQ,cAAc,CAAC,CAAC;AAChC;;AAEA;AACA;AACA;AACA;AACO,SAASC,MAAMA,CAACC,MAAc,EAAQ;EAC3CV,qBAAa,CAACS,MAAM,CAACC,MAAM,CAAC;AAC9B","ignoreList":[]}
1
+ {"version":3,"names":["_native","require","reset","nativeBrowser","play","pause","togglePlayback","stop","retry","seekTo","position","seekToLiveEdge","seekBy","offset"],"sourceRoot":"../../../../src","sources":["features/playback/controls.ts"],"mappings":";;;;;;;;;;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AAFA;;AAIA;AACA;AACA;AACO,SAASC,KAAKA,CAAA,EAAS;EAC5BC,qBAAa,CAACD,KAAK,CAAC,CAAC;AACvB;;AAEA;AACA;AACA;AACO,SAASE,IAAIA,CAAA,EAAS;EAC3BD,qBAAa,CAACC,IAAI,CAAC,CAAC;AACtB;;AAEA;AACA;AACA;AACO,SAASC,KAAKA,CAAA,EAAS;EAC5BF,qBAAa,CAACE,KAAK,CAAC,CAAC;AACvB;;AAEA;AACA;AACA;AACO,SAASC,cAAcA,CAAA,EAAS;EACrCH,qBAAa,CAACG,cAAc,CAAC,CAAC;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,IAAIA,CAAA,EAAS;EAC3BJ,qBAAa,CAACI,IAAI,CAAC,CAAC;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,KAAKA,CAAA,EAAS;EAC5BL,qBAAa,CAACK,KAAK,CAAC,CAAC;AACvB;;AAEA;AACA;AACA;AACA;AACO,SAASC,MAAMA,CAACC,QAAgB,EAAQ;EAC7CP,qBAAa,CAACM,MAAM,CAACC,QAAQ,CAAC;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAAA,EAAS;EACrCR,qBAAa,CAACQ,cAAc,CAAC,CAAC;AAChC;;AAEA;AACA;AACA;AACA;AACO,SAASC,MAAMA,CAACC,MAAc,EAAQ;EAC3CV,qBAAa,CAACS,MAAM,CAACC,MAAM,CAAC;AAC9B","ignoreList":[]}
@@ -27,8 +27,9 @@ function getPlayWhenReady() {
27
27
 
28
28
  /**
29
29
  * Sets whether the player will play automatically when it is ready to do so.
30
- * This is the equivalent of calling `play()` when `playWhenReady = true`
31
- * or `pause()` when `playWhenReady = false`.
30
+ * Before setupPlayer resolves, the value is kept and applied at setup, while
31
+ * play() is dropped on iOS and Android. On Android, `true` does not restart a
32
+ * stopped or failed player; call play() or retry() for that.
32
33
  */
33
34
  function setPlayWhenReady(playWhenReady) {
34
35
  _native.nativeBrowser.setPlayWhenReady(playWhenReady);
@@ -37,9 +38,9 @@ function setPlayWhenReady(playWhenReady) {
37
38
  // MARK: - Event Callbacks
38
39
 
39
40
  /**
40
- * Subscribes to play when ready changes.
41
- * @param callback - Called when playWhenReady changes
42
- * @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
41
+ * Emits each time `playWhenReady` changes. Subscribe with
42
+ * `onPlayWhenReadyChanged.addListener(cb)`, which returns an unsubscribe
43
+ * function.
43
44
  */
44
45
  const onPlayWhenReadyChanged = exports.onPlayWhenReadyChanged = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onPlaybackPlayWhenReadyChanged = cb);
45
46
 
@@ -1 +1 @@
1
- {"version":3,"names":["_native","require","_NativeUpdatedValue","_useNativeUpdatedValue","getPlayWhenReady","nativeBrowser","setPlayWhenReady","playWhenReady","onPlayWhenReadyChanged","exports","NativeUpdatedValue","emitterize","cb","onPlaybackPlayWhenReadyChanged","usePlayWhenReady","useNativeUpdatedValue"],"sourceRoot":"../../../../src","sources":["features/playback/playWhenReady.ts"],"mappings":";;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAEA;AACA;AACA;;AAMA;;AAEA;AACA;AACA;AACO,SAASG,gBAAgBA,CAAA,EAAY;EAC1C,OAAOC,qBAAa,CAACD,gBAAgB,CAAC,CAAC;AACzC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASE,gBAAgBA,CAACC,aAAsB,EAAQ;EAC7DF,qBAAa,CAACC,gBAAgB,CAACC,aAAa,CAAC;AAC/C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMC,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GACjCE,sCAAkB,CAACC,UAAU,CAC1BC,EAAE,IAAMP,qBAAa,CAACQ,8BAA8B,GAAGD,EAC1D,CAAC;;AAEH;;AAEA;AACA;AACA;AACA;AACO,SAASE,gBAAgBA,CAAA,EAAY;EAC1C,OAAO,IAAAC,4CAAqB,EAC1BX,gBAAgB,EAChBI,sBAAsB,EACtB,eACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["_native","require","_NativeUpdatedValue","_useNativeUpdatedValue","getPlayWhenReady","nativeBrowser","setPlayWhenReady","playWhenReady","onPlayWhenReadyChanged","exports","NativeUpdatedValue","emitterize","cb","onPlaybackPlayWhenReadyChanged","usePlayWhenReady","useNativeUpdatedValue"],"sourceRoot":"../../../../src","sources":["features/playback/playWhenReady.ts"],"mappings":";;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAEA;AACA;AACA;;AAMA;;AAEA;AACA;AACA;AACO,SAASG,gBAAgBA,CAAA,EAAY;EAC1C,OAAOC,qBAAa,CAACD,gBAAgB,CAAC,CAAC;AACzC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,gBAAgBA,CAACC,aAAsB,EAAQ;EAC7DF,qBAAa,CAACC,gBAAgB,CAACC,aAAa,CAAC;AAC/C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMC,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GACjCE,sCAAkB,CAACC,UAAU,CAC1BC,EAAE,IAAMP,qBAAa,CAACQ,8BAA8B,GAAGD,EAC1D,CAAC;;AAEH;;AAEA;AACA;AACA;AACA;AACO,SAASE,gBAAgBA,CAAA,EAAY;EAC1C,OAAO,IAAAC,4CAAqB,EAC1BX,gBAAgB,EAChBI,sBAAsB,EACtB,eACF,CAAC;AACH","ignoreList":[]}
@@ -11,6 +11,8 @@ var _NativeUpdatedValue = require("../../utils/NativeUpdatedValue");
11
11
  var _useNativeUpdatedValue = require("../../utils/useNativeUpdatedValue");
12
12
  // MARK: - Types
13
13
 
14
+ /** Whether the player is playing, and whether it is buffering while it does. */
15
+
14
16
  // MARK: - Getters
15
17
 
16
18
  /**
@@ -23,9 +25,9 @@ function getPlayingState() {
23
25
  // MARK: - Event Callbacks
24
26
 
25
27
  /**
26
- * Subscribes to playing state changes.
27
- * @param callback - Called when playing or buffering state changes
28
- * @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
28
+ * Emits the {@link PlayingState} each time `playing` or `buffering` changes.
29
+ * Subscribe with `onPlayingState.addListener(cb)`, which returns an
30
+ * unsubscribe function.
29
31
  */
30
32
  const onPlayingState = exports.onPlayingState = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onPlaybackPlayingState = cb);
31
33
 
@@ -1 +1 @@
1
- {"version":3,"names":["_native","require","_NativeUpdatedValue","_useNativeUpdatedValue","getPlayingState","nativeBrowser","onPlayingState","exports","NativeUpdatedValue","emitterize","cb","onPlaybackPlayingState","usePlayingState","useNativeUpdatedValue"],"sourceRoot":"../../../../src","sources":["features/playback/playing.ts"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAEA;;AAOA;;AAEA;AACA;AACA;AACO,SAASG,eAAeA,CAAA,EAAiB;EAC9C,OAAOC,qBAAa,CAACD,eAAe,CAAC,CAAC;AACxC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAME,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAGE,sCAAkB,CAACC,UAAU,CACxDC,EAAE,IAAML,qBAAa,CAACM,sBAAsB,GAAGD,EAClD,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACO,SAASE,eAAeA,CAAA,EAAiB;EAC9C,OAAO,IAAAC,4CAAqB,EAACT,eAAe,EAAEE,cAAc,CAAC;AAC/D","ignoreList":[]}
1
+ {"version":3,"names":["_native","require","_NativeUpdatedValue","_useNativeUpdatedValue","getPlayingState","nativeBrowser","onPlayingState","exports","NativeUpdatedValue","emitterize","cb","onPlaybackPlayingState","usePlayingState","useNativeUpdatedValue"],"sourceRoot":"../../../../src","sources":["features/playback/playing.ts"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAEA;;AAEA;;AAkBA;;AAEA;AACA;AACA;AACO,SAASG,eAAeA,CAAA,EAAiB;EAC9C,OAAOC,qBAAa,CAACD,eAAe,CAAC,CAAC;AACxC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAME,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAGE,sCAAkB,CAACC,UAAU,CACxDC,EAAE,IAAML,qBAAa,CAACM,sBAAsB,GAAGD,EAClD,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACO,SAASE,eAAeA,CAAA,EAAiB;EAC9C,OAAO,IAAAC,4CAAqB,EAACT,eAAe,EAAEE,cAAc,CAAC;AAC/D","ignoreList":[]}