react-native-audio-browser 0.2.0-next.11 → 0.2.0-next.13

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 (416) hide show
  1. package/README.md +14 -4
  2. package/android/build.gradle +20 -1
  3. package/android/src/main/java/com/audiobrowser/AudioBrowser.kt +115 -26
  4. package/android/src/main/java/com/audiobrowser/browser/BrowserManager.kt +262 -188
  5. package/android/src/main/java/com/audiobrowser/browser/BrowserUrlResolution.kt +23 -3
  6. package/android/src/main/java/com/audiobrowser/browser/InertStyleDiagnostic.kt +267 -0
  7. package/android/src/main/java/com/audiobrowser/browser/JsonModels.kt +95 -58
  8. package/android/src/main/java/com/audiobrowser/browser/SectionScope.kt +68 -26
  9. package/android/src/main/java/com/audiobrowser/browser/StyleResolver.kt +60 -0
  10. package/android/src/main/java/com/audiobrowser/extension/ResolvedTrackExt.kt +19 -7
  11. package/android/src/main/java/com/audiobrowser/extension/TappedTrack.kt +20 -0
  12. package/android/src/main/java/com/audiobrowser/extension/TrackIdentity.kt +15 -0
  13. package/android/src/main/java/com/audiobrowser/model/PlayerUpdateOptions.kt +1 -1
  14. package/android/src/main/java/com/audiobrowser/player/MediaSessionCallback.kt +120 -67
  15. package/android/src/main/java/com/audiobrowser/player/NowPlayingUpdater.kt +21 -24
  16. package/android/src/main/java/com/audiobrowser/player/PlaybackStateStore.kt +109 -74
  17. package/android/src/main/java/com/audiobrowser/player/Player.kt +51 -30
  18. package/android/src/main/java/com/audiobrowser/player/PlayerCapabilitiesExt.kt +2 -15
  19. package/android/src/main/java/com/audiobrowser/player/ShuffleOrderLedBy.kt +30 -0
  20. package/android/src/main/java/com/audiobrowser/util/BrowserPathHelper.kt +44 -40
  21. package/android/src/main/java/com/audiobrowser/util/MediaExtrasBuilder.kt +28 -23
  22. package/android/src/main/java/com/audiobrowser/util/StyleWire.kt +108 -0
  23. package/android/src/main/java/com/audiobrowser/util/TrackFactory.kt +52 -53
  24. package/android/src/test/java/com/audiobrowser/TestFixtures.kt +74 -41
  25. package/android/src/test/java/com/audiobrowser/browser/BrowserManagerFavoritesTest.kt +153 -0
  26. package/android/src/test/java/com/audiobrowser/browser/BrowserManagerTest.kt +229 -50
  27. package/android/src/test/java/com/audiobrowser/browser/BrowserUrlResolutionTest.kt +38 -0
  28. package/android/src/test/java/com/audiobrowser/browser/InertStyleDiagnosticTest.kt +277 -0
  29. package/android/src/test/java/com/audiobrowser/browser/JsonArtworkTest.kt +1 -1
  30. package/android/src/test/java/com/audiobrowser/browser/JsonStyleTest.kt +147 -0
  31. package/android/src/test/java/com/audiobrowser/browser/SectionScopeTest.kt +128 -53
  32. package/android/src/test/java/com/audiobrowser/browser/StyleResolverTest.kt +154 -0
  33. package/android/src/test/java/com/audiobrowser/extension/TappedTrackTest.kt +43 -0
  34. package/android/src/test/java/com/audiobrowser/extension/TrackIdentityTest.kt +41 -0
  35. package/android/src/test/java/com/audiobrowser/player/CapabilityControlsTest.kt +1 -2
  36. package/android/src/test/java/com/audiobrowser/player/NowPlayingUpdaterTest.kt +42 -2
  37. package/android/src/test/java/com/audiobrowser/player/PlaybackStateStoreTrackJsonTest.kt +55 -0
  38. package/android/src/test/java/com/audiobrowser/player/ShuffleOrderLedByTest.kt +79 -0
  39. package/android/src/test/java/com/audiobrowser/util/BrowserPathHelperTest.kt +41 -16
  40. package/android/src/test/java/com/audiobrowser/util/MediaExtrasBuilderTest.kt +161 -0
  41. package/android/src/test/java/com/audiobrowser/util/TrackFactoryMediaIdTest.kt +7 -7
  42. package/ios/Browser/BrowserConfig.swift +102 -5
  43. package/ios/Browser/BrowserManager+URLResolution.swift +18 -14
  44. package/ios/Browser/BrowserManager.swift +229 -180
  45. package/ios/Browser/BrowserPathHelper.swift +44 -44
  46. package/ios/Browser/InertStyleDiagnostic.swift +279 -0
  47. package/ios/Browser/JsonModels.swift +258 -106
  48. package/ios/Browser/SearchDrillIn.swift +6 -6
  49. package/ios/Browser/SectionPresentation.swift +64 -0
  50. package/ios/Browser/SectionScope.swift +58 -24
  51. package/ios/Browser/StyleResolver.swift +58 -0
  52. package/ios/Browser/TabBarEntries.swift +9 -3
  53. package/ios/Browser/TrackIdTemplate.swift +37 -0
  54. package/ios/CarPlay/CarPlayArtworkResolver.swift +8 -7
  55. package/ios/CarPlay/CarPlayController.swift +227 -85
  56. package/ios/CarPlay/CarPlayImageLoader.swift +38 -18
  57. package/ios/CarPlay/CarPlayListItemFactory.swift +289 -84
  58. package/ios/CarPlay/CarPlayNowPlayingManager.swift +15 -12
  59. package/ios/Extension/Capability+RemoteCommand.swift +1 -1
  60. package/ios/Extension/PlayerCapabilities+Favorite.swift +1 -15
  61. package/ios/Extension/ResolvedTrack+Copying.swift +11 -15
  62. package/ios/Extension/Section+Copying.swift +31 -0
  63. package/ios/Extension/Track+Copying.swift +6 -12
  64. package/ios/Extension/Track+Identity.swift +18 -0
  65. package/ios/Extension/UIApplication+ActiveScene.swift +27 -0
  66. package/ios/Http/HttpClient.swift +8 -2
  67. package/ios/HybridAudioBrowser.swift +166 -45
  68. package/ios/Model/NitroTypeStubs.swift +106 -21
  69. package/ios/Model/PlayerUpdateOptions.swift +7 -0
  70. package/ios/Player/MediaIntentCriteria.swift +13 -5
  71. package/ios/Player/MediaLoader.swift +33 -9
  72. package/ios/Player/NowPlayingUpdater.swift +54 -6
  73. package/ios/Player/PlaybackCoordinator.swift +13 -6
  74. package/ios/Player/PlaybackTimer.swift +8 -2
  75. package/ios/Player/QueueManager.swift +36 -10
  76. package/ios/Player/RetryManager.swift +4 -3
  77. package/ios/Player/ShuffleOrder.swift +23 -0
  78. package/ios/Player/SleepTimerHandling.swift +13 -0
  79. package/ios/RemoteCommand/RemoteCommandController.swift +53 -18
  80. package/ios/Tests/BrowserPathHelperTests.swift +50 -20
  81. package/ios/Tests/CarPlayArtworkResolverTests.swift +24 -41
  82. package/ios/Tests/InertStyleDiagnosticTests.swift +200 -0
  83. package/ios/Tests/JsonModelsTests.swift +150 -1
  84. package/ios/Tests/PlaybackStateStoreTests.swift +4 -3
  85. package/ios/Tests/QueueManagerTests.swift +72 -6
  86. package/ios/Tests/RemoteCommandControllerTests.swift +16 -0
  87. package/ios/Tests/ResolvedTrackCopyingTests.swift +37 -35
  88. package/ios/Tests/SearchDrillInTests.swift +16 -16
  89. package/ios/Tests/SectionPresentationTests.swift +90 -0
  90. package/ios/Tests/SectionScopeTests.swift +87 -55
  91. package/ios/Tests/StyleResolverTests.swift +127 -0
  92. package/ios/Tests/Support/TestTypes.swift +7 -0
  93. package/ios/Tests/TabBarEntriesTests.swift +18 -18
  94. package/ios/Tests/TrackIdTemplateTests.swift +67 -0
  95. package/ios/Tests/TrackIdentityTests.swift +20 -0
  96. package/ios/Tests/TrackSelectorTests.swift +168 -33
  97. package/ios/TrackPlayer.swift +57 -34
  98. package/ios/TrackSelector.swift +45 -30
  99. package/ios/Util/ArtworkImageFetcher.swift +16 -1
  100. package/ios/Util/NetworkMonitor.swift +43 -26
  101. package/ios/Util/SFSymbolRenderer.swift +24 -2
  102. package/ios/Util/SVGProcessor.swift +9 -2
  103. package/lib/commonjs/AudioBrowser.js +11 -0
  104. package/lib/commonjs/AudioBrowser.js.map +1 -1
  105. package/lib/commonjs/features/browser-config.js +11 -8
  106. package/lib/commonjs/features/browser-config.js.map +1 -1
  107. package/lib/commonjs/features/browser.js +2 -2
  108. package/lib/commonjs/features/favorites.js +13 -10
  109. package/lib/commonjs/features/favorites.js.map +1 -1
  110. package/lib/commonjs/features/playback/controls.js +4 -2
  111. package/lib/commonjs/features/playback/controls.js.map +1 -1
  112. package/lib/commonjs/features/playback/progress.js +2 -1
  113. package/lib/commonjs/features/playback/progress.js.map +1 -1
  114. package/lib/commonjs/features/playback/rate.js +8 -1
  115. package/lib/commonjs/features/playback/rate.js.map +1 -1
  116. package/lib/commonjs/features/playback/state.js +2 -3
  117. package/lib/commonjs/features/playback/state.js.map +1 -1
  118. package/lib/commonjs/features/player/options.js.map +1 -1
  119. package/lib/commonjs/features/player/setup.js +3 -1
  120. package/lib/commonjs/features/player/setup.js.map +1 -1
  121. package/lib/commonjs/features/player/validateOptions.js +2 -0
  122. package/lib/commonjs/features/player/validateOptions.js.map +1 -1
  123. package/lib/commonjs/features/queue/activeTrack.js +14 -3
  124. package/lib/commonjs/features/queue/activeTrack.js.map +1 -1
  125. package/lib/commonjs/features/queue/queue.js +11 -4
  126. package/lib/commonjs/features/queue/queue.js.map +1 -1
  127. package/lib/commonjs/utils/LazyNativeEmitter.js +21 -10
  128. package/lib/commonjs/utils/LazyNativeEmitter.js.map +1 -1
  129. package/lib/commonjs/utils/NativeUpdatedValue.js +31 -13
  130. package/lib/commonjs/utils/NativeUpdatedValue.js.map +1 -1
  131. package/lib/commonjs/utils/getTrackIdentity.js +24 -0
  132. package/lib/commonjs/utils/getTrackIdentity.js.map +1 -0
  133. package/lib/commonjs/utils/useNativeValueRefreshedBy.js +33 -0
  134. package/lib/commonjs/utils/useNativeValueRefreshedBy.js.map +1 -0
  135. package/lib/commonjs/web/NativeAudioBrowser.js +32 -24
  136. package/lib/commonjs/web/NativeAudioBrowser.js.map +1 -1
  137. package/lib/commonjs/web/TrackPlayer/QueueManager.js +14 -0
  138. package/lib/commonjs/web/TrackPlayer/QueueManager.js.map +1 -1
  139. package/lib/commonjs/web/browser/BrowserManager.js +144 -87
  140. package/lib/commonjs/web/browser/BrowserManager.js.map +1 -1
  141. package/lib/commonjs/web/browser/FavoriteManager.js +30 -21
  142. package/lib/commonjs/web/browser/FavoriteManager.js.map +1 -1
  143. package/lib/commonjs/web/browser/assertBrowsePageShape.js +2 -2
  144. package/lib/commonjs/web/browser/assertBrowsePageShape.js.map +1 -1
  145. package/lib/commonjs/web/browser/classifyTrackNavigation.js +9 -9
  146. package/lib/commonjs/web/browser/classifyTrackNavigation.js.map +1 -1
  147. package/lib/commonjs/web/browser/sections.js +89 -0
  148. package/lib/commonjs/web/browser/sections.js.map +1 -0
  149. package/lib/commonjs/web/player/NowPlayingManager.js +4 -3
  150. package/lib/commonjs/web/player/NowPlayingManager.js.map +1 -1
  151. package/lib/commonjs/web/util/BrowserPathHelper.js +56 -11
  152. package/lib/commonjs/web/util/BrowserPathHelper.js.map +1 -1
  153. package/lib/module/AudioBrowser.js +1 -0
  154. package/lib/module/AudioBrowser.js.map +1 -1
  155. package/lib/module/features/browser-config.js +11 -8
  156. package/lib/module/features/browser-config.js.map +1 -1
  157. package/lib/module/features/browser.js +2 -2
  158. package/lib/module/features/favorites.js +13 -10
  159. package/lib/module/features/favorites.js.map +1 -1
  160. package/lib/module/features/playback/controls.js +4 -2
  161. package/lib/module/features/playback/controls.js.map +1 -1
  162. package/lib/module/features/playback/progress.js +2 -1
  163. package/lib/module/features/playback/progress.js.map +1 -1
  164. package/lib/module/features/playback/rate.js +8 -1
  165. package/lib/module/features/playback/rate.js.map +1 -1
  166. package/lib/module/features/playback/state.js +2 -3
  167. package/lib/module/features/playback/state.js.map +1 -1
  168. package/lib/module/features/player/options.js.map +1 -1
  169. package/lib/module/features/player/setup.js +3 -1
  170. package/lib/module/features/player/setup.js.map +1 -1
  171. package/lib/module/features/player/validateOptions.js +2 -0
  172. package/lib/module/features/player/validateOptions.js.map +1 -1
  173. package/lib/module/features/queue/activeTrack.js +14 -3
  174. package/lib/module/features/queue/activeTrack.js.map +1 -1
  175. package/lib/module/features/queue/queue.js +11 -4
  176. package/lib/module/features/queue/queue.js.map +1 -1
  177. package/lib/module/utils/LazyNativeEmitter.js +21 -10
  178. package/lib/module/utils/LazyNativeEmitter.js.map +1 -1
  179. package/lib/module/utils/NativeUpdatedValue.js +31 -13
  180. package/lib/module/utils/NativeUpdatedValue.js.map +1 -1
  181. package/lib/module/utils/getTrackIdentity.js +20 -0
  182. package/lib/module/utils/getTrackIdentity.js.map +1 -0
  183. package/lib/module/utils/useNativeValueRefreshedBy.js +29 -0
  184. package/lib/module/utils/useNativeValueRefreshedBy.js.map +1 -0
  185. package/lib/module/web/NativeAudioBrowser.js +32 -24
  186. package/lib/module/web/NativeAudioBrowser.js.map +1 -1
  187. package/lib/module/web/TrackPlayer/QueueManager.js +14 -0
  188. package/lib/module/web/TrackPlayer/QueueManager.js.map +1 -1
  189. package/lib/module/web/browser/BrowserManager.js +144 -87
  190. package/lib/module/web/browser/BrowserManager.js.map +1 -1
  191. package/lib/module/web/browser/FavoriteManager.js +31 -21
  192. package/lib/module/web/browser/FavoriteManager.js.map +1 -1
  193. package/lib/module/web/browser/assertBrowsePageShape.js +2 -2
  194. package/lib/module/web/browser/assertBrowsePageShape.js.map +1 -1
  195. package/lib/module/web/browser/classifyTrackNavigation.js +9 -9
  196. package/lib/module/web/browser/classifyTrackNavigation.js.map +1 -1
  197. package/lib/module/web/browser/sections.js +83 -0
  198. package/lib/module/web/browser/sections.js.map +1 -0
  199. package/lib/module/web/player/NowPlayingManager.js +4 -3
  200. package/lib/module/web/player/NowPlayingManager.js.map +1 -1
  201. package/lib/module/web/util/BrowserPathHelper.js +56 -11
  202. package/lib/module/web/util/BrowserPathHelper.js.map +1 -1
  203. package/lib/typescript/src/AudioBrowser.d.ts +1 -0
  204. package/lib/typescript/src/AudioBrowser.d.ts.map +1 -1
  205. package/lib/typescript/src/features/browser-config.d.ts.map +1 -1
  206. package/lib/typescript/src/features/browser.d.ts +2 -2
  207. package/lib/typescript/src/features/favorites.d.ts +13 -10
  208. package/lib/typescript/src/features/favorites.d.ts.map +1 -1
  209. package/lib/typescript/src/features/playback/controls.d.ts +4 -2
  210. package/lib/typescript/src/features/playback/controls.d.ts.map +1 -1
  211. package/lib/typescript/src/features/playback/progress.d.ts.map +1 -1
  212. package/lib/typescript/src/features/playback/rate.d.ts +8 -1
  213. package/lib/typescript/src/features/playback/rate.d.ts.map +1 -1
  214. package/lib/typescript/src/features/playback/state.d.ts +2 -3
  215. package/lib/typescript/src/features/playback/state.d.ts.map +1 -1
  216. package/lib/typescript/src/features/playback/trackPlaybackTime.d.ts +1 -1
  217. package/lib/typescript/src/features/playback/trackPlaybackTime.d.ts.map +1 -1
  218. package/lib/typescript/src/features/player/options.d.ts +21 -19
  219. package/lib/typescript/src/features/player/options.d.ts.map +1 -1
  220. package/lib/typescript/src/features/player/setup.d.ts.map +1 -1
  221. package/lib/typescript/src/features/player/validateOptions.d.ts +1 -8
  222. package/lib/typescript/src/features/player/validateOptions.d.ts.map +1 -1
  223. package/lib/typescript/src/features/queue/activeTrack.d.ts +8 -1
  224. package/lib/typescript/src/features/queue/activeTrack.d.ts.map +1 -1
  225. package/lib/typescript/src/features/queue/queue.d.ts +5 -2
  226. package/lib/typescript/src/features/queue/queue.d.ts.map +1 -1
  227. package/lib/typescript/src/types/browser-native.d.ts +2 -2
  228. package/lib/typescript/src/types/browser-native.d.ts.map +1 -1
  229. package/lib/typescript/src/types/browser-nodes.d.ts +361 -126
  230. package/lib/typescript/src/types/browser-nodes.d.ts.map +1 -1
  231. package/lib/typescript/src/types/browser.d.ts +33 -53
  232. package/lib/typescript/src/types/browser.d.ts.map +1 -1
  233. package/lib/typescript/src/utils/LazyNativeEmitter.d.ts +16 -17
  234. package/lib/typescript/src/utils/LazyNativeEmitter.d.ts.map +1 -1
  235. package/lib/typescript/src/utils/NativeUpdatedValue.d.ts +24 -19
  236. package/lib/typescript/src/utils/NativeUpdatedValue.d.ts.map +1 -1
  237. package/lib/typescript/src/utils/getTrackIdentity.d.ts +18 -0
  238. package/lib/typescript/src/utils/getTrackIdentity.d.ts.map +1 -0
  239. package/lib/typescript/src/utils/useNativeValueRefreshedBy.d.ts +21 -0
  240. package/lib/typescript/src/utils/useNativeValueRefreshedBy.d.ts.map +1 -0
  241. package/nitrogen/generated/android/AudioBrowser+autolinking.cmake +0 -1
  242. package/nitrogen/generated/android/c++/{JFavoritesMatchMode.hpp → JArtworkRendering.hpp} +15 -15
  243. package/nitrogen/generated/android/c++/JArtworkRequestConfig.hpp +8 -3
  244. package/nitrogen/generated/android/c++/JBrowseResult.hpp +16 -4
  245. package/nitrogen/generated/android/c++/JCarPlayPlayingIndicatorLocation.hpp +58 -0
  246. package/nitrogen/generated/android/c++/JCardImage.hpp +58 -0
  247. package/nitrogen/generated/android/c++/JFavoriteChangedEvent.hpp +8 -3
  248. package/nitrogen/generated/android/c++/JFormatNowPlayingParams.hpp +8 -3
  249. package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_RequestConfig___Track.hpp +8 -3
  250. package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__optional_NowPlayingUpdate____FormatNowPlayingParams.hpp +8 -3
  251. package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__optional_std__string____Track.hpp +8 -3
  252. package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_RequestConfig_____Track.hpp +8 -3
  253. package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__vector_Track______SearchParams.hpp +8 -2
  254. package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_void_____TrackLoadEvent.hpp +8 -2
  255. package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__variant_ResolvedTrack__BrowseError__std__shared_ptr_Promise_std__variant_ResolvedTrack__BrowseError_______BrowserSourceCallbackParam.hpp +16 -4
  256. package/nitrogen/generated/android/c++/JFunc_void_FavoriteChangedEvent.hpp +8 -3
  257. package/nitrogen/generated/android/c++/JFunc_void_Options.hpp +2 -5
  258. package/nitrogen/generated/android/c++/JFunc_void_PlaybackActiveTrackChangedEvent.hpp +8 -3
  259. package/nitrogen/generated/android/c++/JFunc_void_std__optional_ResolvedTrack_.hpp +15 -3
  260. package/nitrogen/generated/android/c++/JFunc_void_std__vector_Track_.hpp +8 -2
  261. package/nitrogen/generated/android/c++/JGridTile.hpp +61 -0
  262. package/nitrogen/generated/android/c++/JHybridAudioBrowserSpec.cpp +33 -14
  263. package/nitrogen/generated/android/c++/JIOSOptions.hpp +9 -3
  264. package/nitrogen/generated/android/c++/JImageShape.hpp +58 -0
  265. package/nitrogen/generated/android/c++/JMediaRequestConfig.hpp +8 -3
  266. package/nitrogen/generated/android/c++/JNativeBrowserConfiguration.hpp +22 -10
  267. package/nitrogen/generated/android/c++/JNativeRouteEntry.hpp +14 -2
  268. package/nitrogen/generated/android/c++/JNativeSetupPlayerOptions.hpp +10 -7
  269. package/nitrogen/generated/android/c++/JNativeUpdateOptions.hpp +2 -5
  270. package/nitrogen/generated/android/c++/JNitroIOSUpdateOptions.hpp +9 -3
  271. package/nitrogen/generated/android/c++/JOptions.hpp +2 -5
  272. package/nitrogen/generated/android/c++/JPlaybackActiveTrackChangedEvent.hpp +8 -3
  273. package/nitrogen/generated/android/c++/JPlayerCapabilities.hpp +5 -11
  274. package/nitrogen/generated/android/c++/JResolvedTrack.hpp +55 -51
  275. package/nitrogen/generated/android/c++/JSection.hpp +120 -0
  276. package/nitrogen/generated/android/c++/JSectionStyle.hpp +96 -0
  277. package/nitrogen/generated/android/c++/JStyleDisplay.hpp +58 -0
  278. package/nitrogen/generated/android/c++/JTrack.hpp +23 -48
  279. package/nitrogen/generated/android/c++/JTrackLoadEvent.hpp +8 -2
  280. package/nitrogen/generated/android/c++/JTrackStyle.hpp +46 -18
  281. package/nitrogen/generated/android/c++/JVariant_ResolvedTrack_BrowseError_Promise_BrowseResult_.hpp +16 -4
  282. package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/{FavoritesMatchMode.kt → ArtworkRendering.kt} +5 -5
  283. package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/CarPlayPlayingIndicatorLocation.kt +23 -0
  284. package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/CardImage.kt +23 -0
  285. package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/GridTile.kt +24 -0
  286. package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/IOSOptions.kt +6 -3
  287. package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/ImageShape.kt +23 -0
  288. package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/NativeBrowserConfiguration.kt +5 -5
  289. package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/NitroIOSUpdateOptions.kt +6 -3
  290. package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/PlayerCapabilities.kt +2 -2
  291. package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/ResolvedTrack.kt +12 -18
  292. package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/{FavoriteConfig.kt → Section.kt} +18 -6
  293. package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/SectionStyle.kt +59 -0
  294. package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/StyleDisplay.kt +23 -0
  295. package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/Track.kt +6 -15
  296. package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/TrackStyle.kt +35 -5
  297. package/nitrogen/generated/ios/AudioBrowser-Swift-Cxx-Bridge.hpp +158 -82
  298. package/nitrogen/generated/ios/AudioBrowser-Swift-Cxx-Umbrella.hpp +25 -10
  299. package/nitrogen/generated/ios/c++/HybridAudioBrowserSpecSwift.hpp +25 -10
  300. package/nitrogen/generated/ios/swift/ArtworkRendering.swift +40 -0
  301. package/nitrogen/generated/ios/swift/CarPlayPlayingIndicatorLocation.swift +40 -0
  302. package/nitrogen/generated/ios/swift/CardImage.swift +40 -0
  303. package/nitrogen/generated/ios/swift/GridTile.swift +44 -0
  304. package/nitrogen/generated/ios/swift/IOSOptions.swift +7 -2
  305. package/nitrogen/generated/ios/swift/ImageShape.swift +40 -0
  306. package/nitrogen/generated/ios/swift/NativeBrowserConfiguration.swift +5 -5
  307. package/nitrogen/generated/ios/swift/NitroIOSUpdateOptions.swift +12 -1
  308. package/nitrogen/generated/ios/swift/PlayerCapabilities.swift +8 -27
  309. package/nitrogen/generated/ios/swift/ResolvedTrack.swift +54 -83
  310. package/nitrogen/generated/ios/swift/Section.swift +100 -0
  311. package/nitrogen/generated/ios/swift/SectionStyle.swift +133 -0
  312. package/nitrogen/generated/ios/swift/StyleDisplay.swift +40 -0
  313. package/nitrogen/generated/ios/swift/Track.swift +20 -73
  314. package/nitrogen/generated/ios/swift/TrackStyle.swift +86 -22
  315. package/nitrogen/generated/shared/c++/{FavoritesMatchMode.hpp → ArtworkRendering.hpp} +17 -17
  316. package/nitrogen/generated/shared/c++/CarPlayPlayingIndicatorLocation.hpp +76 -0
  317. package/nitrogen/generated/shared/c++/CardImage.hpp +76 -0
  318. package/nitrogen/generated/shared/c++/GridTile.hpp +80 -0
  319. package/nitrogen/generated/shared/c++/IOSOptions.hpp +9 -2
  320. package/nitrogen/generated/shared/c++/ImageShape.hpp +76 -0
  321. package/nitrogen/generated/shared/c++/NativeBrowserConfiguration.hpp +6 -6
  322. package/nitrogen/generated/shared/c++/NitroIOSUpdateOptions.hpp +9 -2
  323. package/nitrogen/generated/shared/c++/PlayerCapabilities.hpp +6 -9
  324. package/nitrogen/generated/shared/c++/ResolvedTrack.hpp +30 -38
  325. package/nitrogen/generated/shared/c++/Section.hpp +106 -0
  326. package/nitrogen/generated/shared/c++/SectionStyle.hpp +126 -0
  327. package/nitrogen/generated/shared/c++/StyleDisplay.hpp +76 -0
  328. package/nitrogen/generated/shared/c++/Track.hpp +15 -31
  329. package/nitrogen/generated/shared/c++/TrackStyle.hpp +73 -34
  330. package/package.json +7 -2
  331. package/src/AudioBrowser.ts +1 -0
  332. package/src/features/browser-config.test.ts +21 -6
  333. package/src/features/browser-config.ts +11 -8
  334. package/src/features/browser.test.ts +1 -1
  335. package/src/features/browser.ts +2 -2
  336. package/src/features/favorites.ts +13 -10
  337. package/src/features/hook-wiring.test.ts +63 -15
  338. package/src/features/playback/controls.ts +4 -2
  339. package/src/features/playback/progress.ts +2 -1
  340. package/src/features/playback/rate.ts +8 -1
  341. package/src/features/playback/state.ts +2 -3
  342. package/src/features/playback/trackPlaybackTime.ts +1 -1
  343. package/src/features/player/options.ts +27 -19
  344. package/src/features/player/setup.test.ts +12 -3
  345. package/src/features/player/setup.ts +3 -1
  346. package/src/features/player/validateOptions.ts +2 -0
  347. package/src/features/queue/activeTrack.ts +14 -3
  348. package/src/features/queue/queue.ts +11 -4
  349. package/src/nitro-stub-drift.test.ts +40 -0
  350. package/src/public-surface.test.ts +40 -0
  351. package/src/specs/audio-browser.nitro.ts +4 -3
  352. package/src/style-resolution.test.ts +210 -0
  353. package/src/types/browser-native.ts +2 -2
  354. package/src/types/browser-nodes.ts +377 -135
  355. package/src/types/browser.ts +34 -55
  356. package/src/utils/LazyNativeEmitter.ts +20 -10
  357. package/src/utils/NativeUpdatedValue.ts +29 -13
  358. package/src/utils/getTrackIdentity.ts +20 -0
  359. package/src/utils/useNativeValueRefreshedBy.ts +38 -0
  360. package/src/web/NativeAudioBrowser.ts +37 -22
  361. package/src/web/TrackPlayer/QueueManager.test.ts +29 -0
  362. package/src/web/TrackPlayer/QueueManager.ts +14 -0
  363. package/src/web/browser/BrowserManager.ts +176 -95
  364. package/src/web/browser/FavoriteManager.test.ts +84 -0
  365. package/src/web/browser/FavoriteManager.ts +28 -23
  366. package/src/web/browser/assertBrowsePageShape.test.ts +1 -1
  367. package/src/web/browser/assertBrowsePageShape.ts +5 -3
  368. package/src/web/browser/classifyTrackNavigation.test.ts +10 -8
  369. package/src/web/browser/classifyTrackNavigation.ts +9 -9
  370. package/src/web/browser/parseSearchResponse.test.ts +8 -2
  371. package/src/web/browser/sections.test.ts +91 -0
  372. package/src/web/browser/sections.ts +72 -0
  373. package/src/web/player/NowPlayingManager.ts +4 -3
  374. package/src/web/util/BrowserPathHelper.test.ts +52 -0
  375. package/src/web/util/BrowserPathHelper.ts +61 -13
  376. package/website/guide/android-auto.md +114 -0
  377. package/website/guide/android-certificates.md +409 -0
  378. package/website/guide/artwork.md +255 -0
  379. package/website/guide/audio-output.md +135 -0
  380. package/website/guide/automotive.md +86 -0
  381. package/website/guide/basic-usage.md +151 -0
  382. package/website/guide/battery.md +115 -0
  383. package/website/guide/browser.md +581 -0
  384. package/website/guide/carplay.md +620 -0
  385. package/website/guide/configuration.md +173 -0
  386. package/website/guide/equalizer.md +231 -0
  387. package/website/guide/errors.md +310 -0
  388. package/website/guide/favorites.md +154 -0
  389. package/website/guide/gate.md +143 -0
  390. package/website/guide/getting-started.md +46 -0
  391. package/website/guide/hooks.md +238 -0
  392. package/website/guide/live-streams.md +125 -0
  393. package/website/guide/metadata.md +239 -0
  394. package/website/guide/migrating-from-track-player.md +244 -0
  395. package/website/guide/native-callback-fetch.md +127 -0
  396. package/website/guide/network.md +86 -0
  397. package/website/guide/now-playing.md +175 -0
  398. package/website/guide/playback.md +328 -0
  399. package/website/guide/queue.md +300 -0
  400. package/website/guide/remote-controls.md +256 -0
  401. package/website/guide/search.md +255 -0
  402. package/website/guide/sleep-timer.md +268 -0
  403. package/website/guide/track.md +246 -0
  404. package/ios/CarPlay/ImageRowItem+CarPlay.swift +0 -19
  405. package/nitrogen/generated/android/c++/JFavoriteConfig.hpp +0 -58
  406. package/nitrogen/generated/android/c++/JImageRowItem.hpp +0 -105
  407. package/nitrogen/generated/android/c++/JVariant_Boolean_FavoriteConfig.cpp +0 -26
  408. package/nitrogen/generated/android/c++/JVariant_Boolean_FavoriteConfig.hpp +0 -71
  409. package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/ImageRowItem.kt +0 -68
  410. package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/Variant_Boolean_FavoriteConfig.kt +0 -53
  411. package/nitrogen/generated/ios/swift/FavoriteConfig.swift +0 -29
  412. package/nitrogen/generated/ios/swift/FavoritesMatchMode.swift +0 -40
  413. package/nitrogen/generated/ios/swift/ImageRowItem.swift +0 -195
  414. package/nitrogen/generated/ios/swift/Variant_Bool_FavoriteConfig.swift +0 -18
  415. package/nitrogen/generated/shared/c++/FavoriteConfig.hpp +0 -84
  416. package/nitrogen/generated/shared/c++/ImageRowItem.hpp +0 -129
@@ -1,6 +1,229 @@
1
1
  import type { CarPlaySiriListButtonPosition, HttpMethod } from './browser'
2
2
 
3
- export type TrackStyle = 'list' | 'grid'
3
+ /**
4
+ * How a holder's *children* lay out — CSS's inner display type, honored
5
+ * literally (`display: 'grid'` in CSS describes the children, not the
6
+ * element).
7
+ *
8
+ * - `'list'` (default) — full-width rows on every surface.
9
+ * - `'grid'` — artwork tiles; wraps unless {@link SectionStyle.gridWrap}
10
+ * is `false`. Tiles presume artwork: an artwork-less child renders a
11
+ * placeholder tile plus its title. On CarPlay a *wrapping* grid needs
12
+ * iOS 26+ and renders a list before that; a single-line grid renders
13
+ * on every OS.
14
+ */
15
+ export type StyleDisplay = 'list' | 'grid'
16
+
17
+ /**
18
+ * How a track's artwork is rendered.
19
+ *
20
+ * - `'original'` (default) — drawn as-is.
21
+ * - `'stencil'` — treated as a monochrome glyph and tinted to the
22
+ * surface's appearance (black in light mode, white in dark). For
23
+ * monochrome logos and icons; full-color artwork should stay
24
+ * `'original'`.
25
+ */
26
+ export type ArtworkRendering = 'original' | 'stencil'
27
+
28
+ /**
29
+ * The shape a grid tile's artwork is cropped to.
30
+ *
31
+ * - `'rounded-rectangle'` (default) — the standard tile crop.
32
+ * - `'circular'` — the standard presentation for *people* (artists, hosts,
33
+ * DJs). Shape encodes the kind of item, so mixed grids legitimately
34
+ * render circular artists next to rounded albums.
35
+ *
36
+ * Named after Apple's `imageShape` parameter (a platform passthrough), and
37
+ * deliberately without a grid prefix: every tile presentation that takes a
38
+ * shape reads the same property.
39
+ */
40
+ export type ImageShape = 'circular' | 'rounded-rectangle'
41
+
42
+ /**
43
+ * The kind of tile a grid renders.
44
+ *
45
+ * - `'plain'` (default) — artwork tiles with a title.
46
+ * - `'card'` — a larger card with title/subtitle and a
47
+ * {@link TrackStyle.cardTint} color; its image mode is
48
+ * {@link TrackStyle.cardImage}. Cards have no shape.
49
+ * - `'condensed'` — a denser cell carrying title + subtitle; takes
50
+ * {@link TrackStyle.imageShape} and {@link TrackStyle.accessorySymbol}
51
+ * like a plain tile.
52
+ *
53
+ * Element families are mutually exclusive within a container, so this is
54
+ * a container property — hence the enum, and the `grid` prefix.
55
+ */
56
+ export type GridTile = 'plain' | 'card' | 'condensed'
57
+
58
+ /**
59
+ * How a card tile uses its image.
60
+ *
61
+ * - `'normal'` (default) — image above the labels;
62
+ * {@link TrackStyle.cardTint} colors a gradient behind the labels.
63
+ * - `'background'` — the image fills the card full-height with the labels
64
+ * overlaid; `cardTint` becomes the color behind them. Selects the larger
65
+ * artwork target size.
66
+ *
67
+ * An enum rather than a boolean: it names the card's image mode and
68
+ * leaves room for future modes.
69
+ */
70
+ export type CardImage = 'normal' | 'background'
71
+
72
+ /**
73
+ * The style declaration block a {@link Track} may carry: *inherited item
74
+ * properties* (resolved `track ?? section ?? page ?? default`, per
75
+ * property — they travel with the track) plus the *positional*
76
+ * {@link TrackStyle.display} (each holder's own children; never
77
+ * inherited).
78
+ *
79
+ * Rules governing every property:
80
+ *
81
+ * - **Declarations are aspirational.** Each surface renders the
82
+ * properties it understands and ignores the rest — inert, never an
83
+ * error.
84
+ * - **Presentation only.** No style property affects queue scope,
85
+ * playback, or navigation: rendering may truncate what is visible, it
86
+ * never changes what plays. (This is why {@link Track.disabled} is NOT
87
+ * here — it carries behavior, so it lives on Track as a content fact.)
88
+ * - **The inheritance boundary**: a handle's block styles the handle; a
89
+ * page's block is inherited by the page's descendants; nothing
90
+ * inherits across resolution.
91
+ */
92
+ export interface TrackStyle {
93
+ /**
94
+ * How this entity's *children* lay out. The meaning is uniform at
95
+ * every position; only the children differ:
96
+ *
97
+ * - On a {@link Section}: the section's children.
98
+ * - On a resolved page ({@link ResolvedTrack.style}): the declaration
99
+ * for the whole page — a section overrides it for its own children.
100
+ * - On a browsable {@link Track} (the handle): the *advertised*
101
+ * layout of the page it opens. Android Auto decides a page's
102
+ * layout before resolving it, so it is the one reader that acts
103
+ * on the handle's declaration. Declared or it doesn't exist: no
104
+ * value → nothing advertised. The resolved page is the truth.
105
+ * - On a track rendered *playable* (`src` wins the rendering): inert —
106
+ * playables open no page.
107
+ *
108
+ * Never *item*-inherited — each holder speaks only for its own
109
+ * children. Between containers it resolves by scope override, not
110
+ * inheritance: the page declares for its whole scope, a section
111
+ * overrides for its own children.
112
+ *
113
+ * @default 'list'
114
+ *
115
+ * @see https://developer.android.com/training/cars/media/create-media-browser/content-styles
116
+ */
117
+ display?: StyleDisplay
118
+
119
+ /**
120
+ * Inherited (`track ?? section ?? page`): how this item's artwork is
121
+ * rendered — `'stencil'` tints a monochrome glyph to the surface's
122
+ * light/dark appearance.
123
+ *
124
+ * @default 'original'
125
+ *
126
+ * @platform carplay
127
+ */
128
+ artworkRendering?: ArtworkRendering
129
+
130
+ /**
131
+ * Inherited (`track ?? section ?? page`): the shape a grid tile's
132
+ * artwork is cropped to — `'circular'` for people, the default
133
+ * `'rounded-rectangle'` for everything else. Shape follows the item
134
+ * wherever it travels: a circular artist stays circular in whatever
135
+ * grid renders it next. Inert where the presentation has no shape
136
+ * (list rows, pre-26 CarPlay, Android Auto).
137
+ *
138
+ * @default 'rounded-rectangle'
139
+ *
140
+ * @platform carplay
141
+ */
142
+ imageShape?: ImageShape
143
+
144
+ /**
145
+ * Inherited (`track ?? section ?? page`): an SF Symbol name drawn as
146
+ * the item's accessory wherever the current presentation supports one —
147
+ * the trailing edge of a list row, leading the title on an iOS 26 grid
148
+ * tile (placement is the platform's choice per surface). A resolved
149
+ * symbol replaces the derived accessory (the disclosure chevron a
150
+ * browsable row gets); `'none'` clears an inherited value, restoring
151
+ * the derived behavior — inheritance has no other escape, and no SF
152
+ * Symbol is named `none`, so the sentinel is collision-free. Inert off
153
+ * CarPlay.
154
+ *
155
+ * @platform carplay
156
+ */
157
+ accessorySymbol?: string
158
+
159
+ /**
160
+ * Inherited (`track ?? section ?? page`): the card treatment's tint
161
+ * color (hex, e.g. `'#1e3a8a'`) — a gradient behind the labels, or the
162
+ * color behind them when {@link TrackStyle.cardImage} is
163
+ * `'background'`. Card-prefixed: inert unless the container renders
164
+ * `gridTile: 'card'`.
165
+ *
166
+ * @platform carplay
167
+ */
168
+ cardTint?: string
169
+
170
+ /**
171
+ * Inherited (`track ?? section ?? page`): how a card tile uses its
172
+ * image — see {@link CardImage}. Uniform via the section value,
173
+ * mixable per card. Inert unless the container renders
174
+ * `gridTile: 'card'`.
175
+ *
176
+ * @default 'normal'
177
+ *
178
+ * @platform carplay
179
+ */
180
+ cardImage?: CardImage
181
+ }
182
+
183
+ /**
184
+ * A {@link Section}'s (or resolved page's) style declaration block: the
185
+ * *container* properties below, plus — via `extends` — a section-wide
186
+ * value for every inherited {@link TrackStyle} item property (and the
187
+ * section's own positional `display`).
188
+ *
189
+ * Container properties resolve by scope override, not inheritance: the
190
+ * page declares for its whole scope, a section overrides for its own
191
+ * children (`section ?? page ?? default`) — they never flow to items.
192
+ */
193
+ export interface SectionStyle extends TrackStyle {
194
+ /**
195
+ * Whether grid tiles wrap to multiple lines. `false` renders exactly
196
+ * one line — the teaser shelf: a preview of a larger collection,
197
+ * typically paired with {@link Section.path} as the "view all" target.
198
+ *
199
+ * Rendered by CarPlay (a single line of tiles). Android Auto has no
200
+ * single-line tile container — its grid wraps, showing more, never
201
+ * less. Phone UIs typically honor `false` as a horizontal scroller.
202
+ *
203
+ * Inert unless {@link TrackStyle.display} is `'grid'`.
204
+ *
205
+ * @default true
206
+ *
207
+ * @platform carplay
208
+ *
209
+ * @see https://developer.apple.com/documentation/carplay/cplistimagerowitem
210
+ */
211
+ gridWrap?: boolean
212
+
213
+ /**
214
+ * The kind of tile this container's grid renders — see
215
+ * {@link GridTile}. A container property (element families are
216
+ * container-homogeneous), resolved by scope override
217
+ * (`section ?? page`), never per item. Inert unless
218
+ * {@link TrackStyle.display} is `'grid'`, and on CarPlay before
219
+ * iOS 26 (where the treatment drops and the layout survives).
220
+ *
221
+ * @default 'plain'
222
+ *
223
+ * @platform carplay
224
+ */
225
+ gridTile?: GridTile
226
+ }
4
227
 
5
228
  /**
6
229
  * Image source for React Native's `<Image>` component.
@@ -37,12 +260,6 @@ export interface TrackRequest {
37
260
  query?: Record<string, string>
38
261
  }
39
262
 
40
- // export interface BrowserSection {
41
- // title: string
42
- // style?: BrowserItemStyle
43
- // children: Track
44
- // }
45
-
46
263
  /**
47
264
  * Artwork URLs for a track that ships a different image per appearance.
48
265
  *
@@ -67,66 +284,72 @@ export interface ArtworkVariants {
67
284
  /** A single artwork URL, or one per appearance. */
68
285
  export type TrackArtwork = string | ArtworkVariants
69
286
 
70
- export interface ImageRowItem {
287
+ /**
288
+ * A titled, styled group of Tracks within a resolved page — the unit of
289
+ * queue scope. Tapping a playable child queues the section it sits in,
290
+ * identically on every platform and screen width: rendering may truncate
291
+ * what is visible, it never changes what plays.
292
+ */
293
+ export interface Section {
294
+ /** Header text. Absent = headerless group. */
295
+ title?: string
71
296
  /**
72
- * Opaque, stable identifier for this item's track. Round-tripped like
73
- * `Track.id` when the thumbnail is played (see `src`).
297
+ * Secondary line for the section's navigation surface — e.g. the label
298
+ * of the "view all" link a tile section gets on Android Auto.
74
299
  */
75
- id?: string
76
- /** Navigation path. Tapping this thumbnail navigates to this URL. */
77
- url?: string
300
+ subtitle?: string
78
301
  /**
79
- * Direct audio source. When present, tapping this thumbnail plays it
80
- * immediately (same selection path as a playable list row) instead of
81
- * navigating. Takes precedence over `url`.
302
+ * Presentation, separated from content. Each surface renders the
303
+ * declared layout's nearest supported form; on CarPlay
304
+ * a wrapping grid requires iOS 26+ and renders a list before that,
305
+ * since CarPlay's only earlier tile container truncates at a width the
306
+ * system doesn't report. Use the artwork `resolve` hook to supply
307
+ * fallback art for tile layouts.
82
308
  */
83
- src?: string
84
- /** Artwork URL for the thumbnail image. */
85
- artwork?: string
86
- /** Output only — populated by the artwork transform pipeline. */
87
- readonly artworkSource?: ImageSource
88
- /** Title of this item. Shown as the thumbnail caption; used for identification and accessibility. */
89
- title: string
90
- /** Now-playing secondary line when played via `src` (mirrors `Track.artist`). */
91
- artist?: string
92
- /** Now-playing album line when played via `src` (mirrors `Track.album`). */
93
- album?: string
94
- /** Navigation target of the album line when played via `src` (mirrors `Track.albumUrl`). */
95
- albumUrl?: string
96
- /** Live stream indicator when played via `src` (mirrors `Track.live`). */
97
- live?: boolean
98
- /** Per-item media-request override when played via `src` (mirrors `Track.request`). */
99
- request?: TrackRequest
309
+ style?: SectionStyle
310
+ /**
311
+ * Navigation target for the section header / "view all" surface. A
312
+ * tile section's header tap (CarPlay) and appended "view all" link
313
+ * (Android Auto) navigate here. Absent = a self-contained section:
314
+ * the header is a plain label, not a link.
315
+ */
316
+ path?: string
317
+ /** The section's tracks. */
318
+ children: Track[]
100
319
  }
101
320
 
321
+ /**
322
+ * The one node type of the browse tree — every tab, folder, station,
323
+ * episode, and queue item is a Track. What a Track *is* follows from which
324
+ * address fields it carries: a {@link path} makes it **browsable** (it opens
325
+ * as a page), a {@link src} makes it **playable** (it can be loaded into the
326
+ * player); at least one of the two is required. The remaining fields are
327
+ * display metadata ({@link title}, {@link artist}, {@link artwork}, …) and
328
+ * content state ({@link favorited}, {@link live}, {@link disabled}).
329
+ */
102
330
  export interface Track {
103
331
  /**
104
332
  * Opaque, stable identifier for this track.
105
333
  *
334
+ * A track's **identity** is `id` when set (non-blank), falling back to
335
+ * `src`. That single rule drives every comparison the library makes:
336
+ * favorites matching (`setFavorites`), the CarPlay / Android Auto
337
+ * "now playing" row indicator, section scoping and skip-in-place, and the
338
+ * contextual queue re-expansion. Two tracks refer to the same item iff
339
+ * their identities are equal — so set `id` consistently on every surface,
340
+ * or on none.
341
+ *
106
342
  * The library never parses or derives anything from this value — it is
107
- * round-tripped verbatim through `setQueue`, `getActiveTrack`, the queue, and
108
- * `onActiveTrackChanged`, so consumers can recognise which item became active
109
- * after an external transport change (lock screen / CarPlay / Android Auto /
110
- * Bluetooth next-previous) without parsing the playable `src`.
111
- *
112
- * When present on a playable track it is also the track's *identity* on car
113
- * browse surfaces: CarPlay's and Android Auto's "now playing" row indicator
114
- * match the active track to browse rows by `id` (falling back to exact `src`
115
- * equality for tracks without one). Assign ids when your playable `src`
116
- * strings for the same item can differ between browse rows and loaded tracks
117
- * (absolute vs relative URLs, volatile query params) — otherwise the
118
- * indicator never matches.
119
- *
120
- * It is also handed to the per-track `MediaRequestConfig.resolve` and
121
- * `ArtworkRequestConfig.resolve` hooks, so requests can be built from a stable
122
- * id (e.g. supply tracks with only an `id` and synthesise `src` in `resolve`).
123
- *
124
- * Optional: consumers whose `url`/`src` strings are already stable across
125
- * surfaces can ignore it.
126
- *
127
- * Note: an Android Auto item selected directly from the browse tree that the
128
- * consumer never queued is identified only by `url`/`src`, so `id` may be
129
- * undefined on that specific path.
343
+ * round-tripped verbatim through `setQueue`, `getActiveTrack`, the queue,
344
+ * `onActiveTrackChanged`, and `onFavoriteChanged`, and handed to the
345
+ * per-track `MediaRequestConfig.resolve` / `ArtworkRequestConfig.resolve`
346
+ * hooks so requests can be built from the stable id.
347
+ *
348
+ * Optional: consumers whose `src` strings are identical wherever the same
349
+ * item appears can ignore it — their identity is the `src`. Assign ids when
350
+ * `src` strings for the same item can differ between surfaces (absolute vs
351
+ * relative URLs, volatile query params), or when favorites are stored as an
352
+ * identifier that isn't the playable URL.
130
353
  */
131
354
  id?: string
132
355
 
@@ -134,9 +357,13 @@ export interface Track {
134
357
  * Navigation path. When present, this track is a container (tab, album, playlist, folder)
135
358
  * that can be navigated into to view its contents.
136
359
  *
137
- * At least one of `url` or `src` must be defined.
360
+ * At least one of `path` or `src` must be defined. When both are set, current
361
+ * surfaces treat the track as playable — `src` wins the rendering, and the
362
+ * browse pipeline replaces a playable track's `path` with its contextual
363
+ * path — so a consumer-supplied `path` on a playable track is not reachable
364
+ * today.
138
365
  */
139
- url?: string
366
+ path?: string
140
367
 
141
368
  /**
142
369
  * Direct audio source identifier. When present, this track can be played directly.
@@ -145,7 +372,7 @@ export interface Track {
145
372
  * any string (file path, custom identifier, etc.) that will be passed to
146
373
  * MediaRequestConfig.resolve to transform it into the actual media request.
147
374
  *
148
- * At least one of `url` or `src` must be defined.
375
+ * At least one of `path` or `src` must be defined.
149
376
  */
150
377
  src?: string
151
378
 
@@ -159,7 +386,8 @@ export interface Track {
159
386
  * Pass an {@link ArtworkVariants} pair to supply genuinely different images
160
387
  * per appearance — a logo that changes colour, say. For a monochrome glyph
161
388
  * that only needs recolouring, prefer a single URL plus
162
- * {@link Track.artworkCarPlayTinted}, which is one fetch instead of two.
389
+ * `style: { artworkRendering: 'stencil' }`, which is one fetch instead
390
+ * of two.
163
391
  *
164
392
  * **iOS:** supports {@link https://developer.apple.com/sf-symbols/ | SF Symbols}
165
393
  * with the `sf:` prefix and optional color params:
@@ -189,23 +417,6 @@ export interface Track {
189
417
  /** Per-track media-request override; merged last (request → media → track.request). */
190
418
  request?: TrackRequest
191
419
 
192
- /**
193
- * Whether this artwork should be tinted based on CarPlay's current appearance (light/dark mode).
194
- *
195
- * When `true`, the artwork is treated as a monochrome icon and tinted:
196
- * - Light mode: tinted black for visibility on light backgrounds
197
- * - Dark mode: tinted white for visibility on dark backgrounds
198
- *
199
- * This is useful for SVG or PNG icons that need to adapt to CarPlay's light/dark themes.
200
- * Full-color artwork (album covers, logos) should not use this.
201
- *
202
- * **iOS CarPlay only** - Android Auto is dark-only, so content providers should
203
- * provide appropriately colored icons directly (e.g., white icons).
204
- *
205
- * @default false
206
- */
207
- artworkCarPlayTinted?: boolean
208
-
209
420
  // type?: TrackType
210
421
  /** Primary line shown for this item, in both browse lists and now-playing. */
211
422
  title: string
@@ -231,9 +442,9 @@ export interface Track {
231
442
 
232
443
  /**
233
444
  * Browse path the {@link album} line navigates to (same path namespace as
234
- * {@link url}). On CarPlay, when the active track has an `albumUrl`, its
445
+ * {@link path}). On CarPlay, when the active track has an `albumPath`, its
235
446
  * album line on the Now Playing screen becomes tappable and navigates the
236
- * browse stack there. See also `resolveAlbumUrl` in the browser
447
+ * browse stack there. See also `resolveAlbumPath` in the browser
237
448
  * configuration for a dynamic fallback.
238
449
  *
239
450
  * Requires {@link album} to be set: CarPlay renders the tappable line from
@@ -241,10 +452,28 @@ export interface Track {
241
452
  *
242
453
  * @platform ios
243
454
  */
244
- albumUrl?: string
455
+ albumPath?: string
245
456
 
457
+ /**
458
+ * Album name, shown on now-playing surfaces that have an album slot
459
+ * (CarPlay, Android Auto, Bluetooth metadata — the iOS lock screen has
460
+ * none). With {@link albumPath} set, CarPlay renders it as a tappable
461
+ * line that navigates there.
462
+ */
246
463
  album?: string
464
+
465
+ /**
466
+ * Longer free-form text about the item, passed to the platform's
467
+ * description metadata slot where one exists. Not shown on browse rows
468
+ * (those render {@link title} / {@link subtitle}) or the lock screen.
469
+ */
247
470
  description?: string
471
+
472
+ /**
473
+ * Genre name, passed to the platform's genre metadata slot where one
474
+ * exists. Catalog metadata only — the library never matches search or
475
+ * browse against it.
476
+ */
248
477
  genre?: string
249
478
 
250
479
  /**
@@ -255,30 +484,31 @@ export interface Track {
255
484
  duration?: number
256
485
 
257
486
  /**
258
- * Display style for this item in Android Auto/AAOS.
259
- * - 'list': Display as a list row
260
- * - 'grid': Display as a grid tile
261
- *
262
- * On Android: when `artwork` is an `android.resource://` URI
263
- * (e.g., `android.resource://com.myapp/drawable/ic_folder`), the library
264
- * automatically uses 'category' styling which adds margins around the icon
265
- * and enables system tinting for vector drawables.
266
- *
267
- * @see https://developer.android.com/training/cars/media#default-content-style
487
+ * The track's style declaration block: inherited item properties (a
488
+ * per-item override of section/page values — they travel with the
489
+ * track), plus the positional {@link TrackStyle.display} — on a
490
+ * browsable track, the advertised layout of the page it opens, read
491
+ * by Android Auto, which picks a page's layout before resolving it.
268
492
  */
269
493
  style?: TrackStyle
270
494
 
271
495
  /**
272
- * Display style for this item's children in Android Auto/AAOS.
273
- * Only applies to browsable items (containers/folders).
274
- * - 'list': Display children as list rows
275
- * - 'grid': Display children as grid tiles
496
+ * Unavailable — a content-state fact beside `favorited` and `live`,
497
+ * with full behavioral weight (content facts may carry behavior; style
498
+ * never does): a disabled track never plays — tap refused, queue
499
+ * expansion excludes it, voice search won't match it.
276
500
  *
277
- * Must be set on the item when it appears as a child in a parent's list.
278
- * Android Auto reads the extras at that point to determine how to display
279
- * the folder's contents when navigated into.
501
+ * Rendering ladder, never a trap: **grayed + inert** where the surface
502
+ * can draw it (CarPlay) → **hidden** where it can't (Android Auto) —
503
+ * never a normal-looking dead control. Hiding is behavior-safe because
504
+ * the track is inert everywhere regardless; the cost is losing the
505
+ * "Available at 9 PM" tease on surfaces that hide, so put the reason
506
+ * in the title for the ones that gray. Applied at page (re-)serve,
507
+ * like style.
508
+ *
509
+ * @default false
280
510
  */
281
- childrenStyle?: TrackStyle
511
+ disabled?: boolean
282
512
 
283
513
  /**
284
514
  * Whether this track is favorited. When the `favorite` capability is enabled,
@@ -287,40 +517,31 @@ export interface Track {
287
517
  favorited?: boolean
288
518
 
289
519
  /**
290
- * Group title for section headers in Android Auto/AAOS.
291
- * Items with the same groupTitle are displayed under a shared section header.
292
- * Items must be contiguous to form a single group.
293
- */
294
- groupTitle?: string
295
-
296
- /**
297
- * Whether this track is a live stream. When true, displays a "live" indicator
298
- * in iOS now playing interfaces.
299
- */
300
- live?: boolean
301
-
302
- /**
303
- * When present, renders this track as a horizontal row of tappable artwork
304
- * thumbnails instead of a standard list item.
305
- *
306
- * - Track.title → row header text
307
- * - Track.url → navigated when header is tapped (optional)
308
- * - Each ImageRowItem → one thumbnail in the horizontal row; a thumbnail
309
- * with `src` plays immediately on tap, otherwise its `url` is navigated
520
+ * Declares this track a live broadcast rather than a file. The players
521
+ * detect *transport* liveness (sliding windows, buffering) themselves;
522
+ * this declaration drives the semantic decisions they can't infer:
310
523
  *
311
- * On CarPlay: maps to CPListImageRowItem. Limits visible images by display
312
- * width (~4-5). Excess silently truncated. A row whose track has no `url`
313
- * is a pure preview: its header is not tappable.
524
+ * - **End of stream** (iOS): a live track "ending" is judged a dropped
525
+ * broadcast and recovered by rejoining the edge, never a queue advance.
526
+ * - **Stall recovery** (iOS): a live track that runs dry reconnects at
527
+ * the edge; a non-live one resumes its existing connection.
528
+ * - **`seekToLiveEdge()`** (all platforms): the call only acts on a
529
+ * track declared live — without the declaration it is a no-op.
530
+ * - **Persistence** (iOS): no position is stored, so a cold-start resume
531
+ * rejoins the current broadcast instead of seeking a stale timestamp.
532
+ * - **Now-playing** (iOS): the live indicator and live-style
533
+ * (non-scrubbing) progress UI.
314
534
  *
315
- * On Android Auto: there is no image-row rendering, so the row expands into
316
- * its items as grid-styled rows (artwork tiles where the host honors the
317
- * per-item content-style hint, list rows otherwise) grouped under the
318
- * track's title, followed by the track itself as a browsable "view all"
319
- * link when it has a `url`.
535
+ * The iOS-heavy list is deliberate, not a gap: on Android, ExoPlayer's
536
+ * own classification already covers these — a dropped live connection
537
+ * surfaces as a load error (never end-of-stream), and persistence keys
538
+ * off its detected liveness — so the declaration's only Android reader
539
+ * is the `seekToLiveEdge()` gate. Android Auto has no live badge.
320
540
  *
321
- * On app side: consumable by React Native UI for horizontal thumbnail layouts.
541
+ * Omitting it never breaks playback — it silently breaks these judgment
542
+ * calls. Declare it on every live track.
322
543
  */
323
- imageRow?: ImageRowItem[]
544
+ live?: boolean
324
545
  }
325
546
 
326
547
  /**
@@ -333,22 +554,43 @@ export interface Track {
333
554
  * ```ts
334
555
  * // navigate() is fire-and-forget (returns void); read the resolved page
335
556
  * // from getContent() / useContent() / onContentChanged.
336
- * navigate('albums/abbey-road');
557
+ * navigate('/albums/abbey-road');
337
558
  * const resolved = getContent();
338
- * console.log(resolved?.url); // "albums/abbey-road"
559
+ * console.log(resolved?.path); // "/albums/abbey-road"
339
560
  * console.log(resolved?.title); // "Abbey Road"
340
- * console.log(resolved?.children); // Array of tracks in this album
561
+ * console.log(resolved?.sections); // the album's tracks, as sections
341
562
  * ```
342
563
  */
343
564
  export interface ResolvedTrack extends Track {
344
565
  /**
345
- * URL path for this resolved track. Always present since you navigated to this location.
566
+ * Browse path of this resolved track. Always present since you navigated to this location.
567
+ */
568
+ path: string
569
+
570
+ /**
571
+ * A page is a Track that is also the container of its sections, so its
572
+ * block widens to {@link SectionStyle}: the declaration for the whole
573
+ * page. Item properties set here are inherited by every item on the
574
+ * page unless a section or track declares its own; the container
575
+ * property (`gridWrap`) and the positional `display` are the page-wide
576
+ * values a section overrides for its own children.
577
+ */
578
+ style?: SectionStyle
579
+
580
+ /**
581
+ * The page's sections — the canonical resolved shape. Every resolved page
582
+ * with content carries `sections`; a page authored with plain `children`
583
+ * resolves to a single untitled section.
346
584
  */
347
- url: string
585
+ sections?: Section[]
348
586
 
349
587
  /**
350
- * Immediate children of this track. Present for container tracks (albums, playlists, folders).
351
- * Undefined for leaf tracks (individual songs without children).
588
+ * Authoring sugar for a flat page: equivalent to declaring one untitled,
589
+ * style-less section holding these tracks (which therefore takes the
590
+ * page block's scope-wide values, like any undeclared section). Accepted
591
+ * anywhere a page is authored (static routes, browse callbacks, JSON
592
+ * payloads); never populated on a *resolved* page — read `sections`
593
+ * instead.
352
594
  */
353
595
  children?: Track[]
354
596