react-native-audio-browser 0.2.0-next.10 → 0.2.0-next.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/android/build.gradle +6 -5
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/audiobrowser/AudioBrowser.kt +110 -25
- package/android/src/main/java/com/audiobrowser/browser/BrowserManager.kt +254 -188
- package/android/src/main/java/com/audiobrowser/browser/BrowserUrlResolution.kt +23 -3
- package/android/src/main/java/com/audiobrowser/browser/JsonModels.kt +77 -58
- package/android/src/main/java/com/audiobrowser/browser/SectionScope.kt +68 -26
- package/android/src/main/java/com/audiobrowser/browser/StyleResolver.kt +49 -0
- package/android/src/main/java/com/audiobrowser/extension/ResolvedTrackExt.kt +9 -7
- package/android/src/main/java/com/audiobrowser/extension/TappedTrack.kt +20 -0
- package/android/src/main/java/com/audiobrowser/extension/TrackIdentity.kt +15 -0
- package/android/src/main/java/com/audiobrowser/player/MediaSessionCallback.kt +120 -67
- package/android/src/main/java/com/audiobrowser/player/NowPlayingUpdater.kt +21 -24
- package/android/src/main/java/com/audiobrowser/player/PlaybackStateStore.kt +93 -73
- package/android/src/main/java/com/audiobrowser/player/Player.kt +48 -30
- package/android/src/main/java/com/audiobrowser/player/PlayerCapabilitiesExt.kt +2 -15
- package/android/src/main/java/com/audiobrowser/tls/AiaCertChaser.kt +46 -5
- package/android/src/main/java/com/audiobrowser/tls/AiaChasingExtendedTrustManager.kt +86 -27
- package/android/src/main/java/com/audiobrowser/tls/AiaChasingTrustManager.kt +58 -14
- package/android/src/main/java/com/audiobrowser/tls/AiaTls.kt +20 -6
- package/android/src/main/java/com/audiobrowser/tls/CachingCertificateFetcher.kt +249 -86
- package/android/src/main/java/com/audiobrowser/util/BrowserPathHelper.kt +44 -40
- package/android/src/main/java/com/audiobrowser/util/MediaExtrasBuilder.kt +28 -23
- package/android/src/main/java/com/audiobrowser/util/StyleWire.kt +35 -0
- package/android/src/main/java/com/audiobrowser/util/TrackFactory.kt +45 -53
- package/android/src/test/java/com/audiobrowser/TestFixtures.kt +69 -30
- package/android/src/test/java/com/audiobrowser/browser/BrowserManagerFavoritesTest.kt +153 -0
- package/android/src/test/java/com/audiobrowser/browser/BrowserManagerLayerResolutionTest.kt +6 -0
- package/android/src/test/java/com/audiobrowser/browser/BrowserManagerTest.kt +345 -8
- package/android/src/test/java/com/audiobrowser/browser/BrowserUrlResolutionTest.kt +38 -0
- package/android/src/test/java/com/audiobrowser/browser/JsonArtworkTest.kt +1 -1
- package/android/src/test/java/com/audiobrowser/browser/JsonStyleTest.kt +91 -0
- package/android/src/test/java/com/audiobrowser/browser/SectionScopeTest.kt +128 -53
- package/android/src/test/java/com/audiobrowser/browser/StyleResolverTest.kt +87 -0
- package/android/src/test/java/com/audiobrowser/extension/TappedTrackTest.kt +43 -0
- package/android/src/test/java/com/audiobrowser/extension/TrackIdentityTest.kt +41 -0
- package/android/src/test/java/com/audiobrowser/player/CapabilityControlsTest.kt +1 -2
- package/android/src/test/java/com/audiobrowser/player/NowPlayingUpdaterTest.kt +42 -2
- package/android/src/test/java/com/audiobrowser/player/PlaybackStateStoreTrackJsonTest.kt +55 -0
- package/android/src/test/java/com/audiobrowser/tls/AiaCertChaserTest.kt +152 -8
- package/android/src/test/java/com/audiobrowser/tls/AiaChasingTrustManagerTest.kt +218 -10
- package/android/src/test/java/com/audiobrowser/tls/CachingCertificateFetcherCallSiteTest.kt +322 -0
- package/android/src/test/java/com/audiobrowser/util/BrowserPathHelperTest.kt +41 -16
- package/android/src/test/java/com/audiobrowser/util/MediaExtrasBuilderTest.kt +161 -0
- package/android/src/test/java/com/audiobrowser/util/TrackFactoryMediaIdTest.kt +7 -7
- package/ios/Browser/BrowserConfig.swift +102 -5
- package/ios/Browser/BrowserManager+URLResolution.swift +18 -14
- package/ios/Browser/BrowserManager.swift +131 -143
- package/ios/Browser/BrowserPathHelper.swift +44 -44
- package/ios/Browser/JsonModels.swift +187 -106
- package/ios/Browser/SearchDrillIn.swift +6 -6
- package/ios/Browser/SectionPresentation.swift +34 -0
- package/ios/Browser/SectionScope.swift +58 -24
- package/ios/Browser/StyleResolver.swift +47 -0
- package/ios/Browser/TabBarEntries.swift +2 -2
- package/ios/Browser/TrackIdTemplate.swift +37 -0
- package/ios/CarPlay/CarPlayArtworkResolver.swift +8 -7
- package/ios/CarPlay/CarPlayController.swift +105 -67
- package/ios/CarPlay/CarPlayImageLoader.swift +38 -18
- package/ios/CarPlay/CarPlayListItemFactory.swift +217 -84
- package/ios/CarPlay/CarPlayNowPlayingManager.swift +15 -12
- package/ios/Extension/Capability+RemoteCommand.swift +1 -1
- package/ios/Extension/PlayerCapabilities+Favorite.swift +1 -15
- package/ios/Extension/ResolvedTrack+Copying.swift +11 -15
- package/ios/Extension/Section+Copying.swift +31 -0
- package/ios/Extension/Track+Copying.swift +6 -12
- package/ios/Extension/Track+Identity.swift +18 -0
- package/ios/HybridAudioBrowser.swift +113 -35
- package/ios/Model/NitroTypeStubs.swift +64 -23
- package/ios/Model/PlayerUpdateOptions.swift +7 -0
- package/ios/Player/NowPlayingUpdater.swift +1 -1
- package/ios/Player/PlaybackCoordinator.swift +2 -2
- package/ios/Player/RetryManager.swift +4 -3
- package/ios/Tests/BrowserPathHelperTests.swift +50 -20
- package/ios/Tests/CarPlayArtworkResolverTests.swift +24 -41
- package/ios/Tests/JsonModelsTests.swift +75 -1
- package/ios/Tests/PlaybackStateStoreTests.swift +4 -3
- package/ios/Tests/QueueManagerTests.swift +4 -4
- package/ios/Tests/ResolvedTrackCopyingTests.swift +37 -35
- package/ios/Tests/SearchDrillInTests.swift +16 -16
- package/ios/Tests/SectionPresentationTests.swift +61 -0
- package/ios/Tests/SectionScopeTests.swift +87 -55
- package/ios/Tests/StyleResolverTests.swift +67 -0
- package/ios/Tests/TabBarEntriesTests.swift +18 -18
- package/ios/Tests/TrackIdTemplateTests.swift +67 -0
- package/ios/Tests/TrackIdentityTests.swift +20 -0
- package/ios/Tests/TrackSelectorTests.swift +168 -33
- package/ios/TrackSelector.swift +45 -30
- package/ios/Util/ArtworkImageFetcher.swift +16 -1
- package/lib/commonjs/AudioBrowser.js +11 -0
- package/lib/commonjs/AudioBrowser.js.map +1 -1
- package/lib/commonjs/features/browser-config.js +11 -8
- package/lib/commonjs/features/browser-config.js.map +1 -1
- package/lib/commonjs/features/browser.js +2 -2
- package/lib/commonjs/features/favorites.js +13 -10
- package/lib/commonjs/features/favorites.js.map +1 -1
- package/lib/commonjs/features/playback/controls.js +4 -2
- package/lib/commonjs/features/playback/controls.js.map +1 -1
- package/lib/commonjs/features/playback/state.js +2 -3
- package/lib/commonjs/features/playback/state.js.map +1 -1
- package/lib/commonjs/features/player/options.js.map +1 -1
- package/lib/commonjs/features/player/setup.js +3 -1
- package/lib/commonjs/features/player/setup.js.map +1 -1
- package/lib/commonjs/features/player/validateOptions.js +2 -0
- package/lib/commonjs/features/player/validateOptions.js.map +1 -1
- package/lib/commonjs/features/queue/activeTrack.js +14 -3
- package/lib/commonjs/features/queue/activeTrack.js.map +1 -1
- package/lib/commonjs/features/queue/queue.js +11 -4
- package/lib/commonjs/features/queue/queue.js.map +1 -1
- package/lib/commonjs/utils/LazyNativeEmitter.js +21 -10
- package/lib/commonjs/utils/LazyNativeEmitter.js.map +1 -1
- package/lib/commonjs/utils/NativeUpdatedValue.js +31 -13
- package/lib/commonjs/utils/NativeUpdatedValue.js.map +1 -1
- package/lib/commonjs/utils/getTrackIdentity.js +24 -0
- package/lib/commonjs/utils/getTrackIdentity.js.map +1 -0
- package/lib/commonjs/utils/useNativeValueRefreshedBy.js +33 -0
- package/lib/commonjs/utils/useNativeValueRefreshedBy.js.map +1 -0
- package/lib/commonjs/web/NativeAudioBrowser.js +32 -24
- package/lib/commonjs/web/NativeAudioBrowser.js.map +1 -1
- package/lib/commonjs/web/browser/BrowserManager.js +144 -87
- package/lib/commonjs/web/browser/BrowserManager.js.map +1 -1
- package/lib/commonjs/web/browser/FavoriteManager.js +30 -21
- package/lib/commonjs/web/browser/FavoriteManager.js.map +1 -1
- package/lib/commonjs/web/browser/assertBrowsePageShape.js +2 -2
- package/lib/commonjs/web/browser/assertBrowsePageShape.js.map +1 -1
- package/lib/commonjs/web/browser/classifyTrackNavigation.js +9 -9
- package/lib/commonjs/web/browser/classifyTrackNavigation.js.map +1 -1
- package/lib/commonjs/web/browser/sections.js +89 -0
- package/lib/commonjs/web/browser/sections.js.map +1 -0
- package/lib/commonjs/web/player/NowPlayingManager.js +4 -3
- package/lib/commonjs/web/player/NowPlayingManager.js.map +1 -1
- package/lib/commonjs/web/util/BrowserPathHelper.js +56 -11
- package/lib/commonjs/web/util/BrowserPathHelper.js.map +1 -1
- package/lib/module/AudioBrowser.js +1 -0
- package/lib/module/AudioBrowser.js.map +1 -1
- package/lib/module/features/browser-config.js +11 -8
- package/lib/module/features/browser-config.js.map +1 -1
- package/lib/module/features/browser.js +2 -2
- package/lib/module/features/favorites.js +13 -10
- package/lib/module/features/favorites.js.map +1 -1
- package/lib/module/features/playback/controls.js +4 -2
- package/lib/module/features/playback/controls.js.map +1 -1
- package/lib/module/features/playback/state.js +2 -3
- package/lib/module/features/playback/state.js.map +1 -1
- package/lib/module/features/player/options.js.map +1 -1
- package/lib/module/features/player/setup.js +3 -1
- package/lib/module/features/player/setup.js.map +1 -1
- package/lib/module/features/player/validateOptions.js +2 -0
- package/lib/module/features/player/validateOptions.js.map +1 -1
- package/lib/module/features/queue/activeTrack.js +14 -3
- package/lib/module/features/queue/activeTrack.js.map +1 -1
- package/lib/module/features/queue/queue.js +11 -4
- package/lib/module/features/queue/queue.js.map +1 -1
- package/lib/module/utils/LazyNativeEmitter.js +21 -10
- package/lib/module/utils/LazyNativeEmitter.js.map +1 -1
- package/lib/module/utils/NativeUpdatedValue.js +31 -13
- package/lib/module/utils/NativeUpdatedValue.js.map +1 -1
- package/lib/module/utils/getTrackIdentity.js +20 -0
- package/lib/module/utils/getTrackIdentity.js.map +1 -0
- package/lib/module/utils/useNativeValueRefreshedBy.js +29 -0
- package/lib/module/utils/useNativeValueRefreshedBy.js.map +1 -0
- package/lib/module/web/NativeAudioBrowser.js +32 -24
- package/lib/module/web/NativeAudioBrowser.js.map +1 -1
- package/lib/module/web/browser/BrowserManager.js +144 -87
- package/lib/module/web/browser/BrowserManager.js.map +1 -1
- package/lib/module/web/browser/FavoriteManager.js +31 -21
- package/lib/module/web/browser/FavoriteManager.js.map +1 -1
- package/lib/module/web/browser/assertBrowsePageShape.js +2 -2
- package/lib/module/web/browser/assertBrowsePageShape.js.map +1 -1
- package/lib/module/web/browser/classifyTrackNavigation.js +9 -9
- package/lib/module/web/browser/classifyTrackNavigation.js.map +1 -1
- package/lib/module/web/browser/sections.js +83 -0
- package/lib/module/web/browser/sections.js.map +1 -0
- package/lib/module/web/player/NowPlayingManager.js +4 -3
- package/lib/module/web/player/NowPlayingManager.js.map +1 -1
- package/lib/module/web/util/BrowserPathHelper.js +56 -11
- package/lib/module/web/util/BrowserPathHelper.js.map +1 -1
- package/lib/typescript/src/AudioBrowser.d.ts +1 -0
- package/lib/typescript/src/AudioBrowser.d.ts.map +1 -1
- package/lib/typescript/src/features/browser-config.d.ts.map +1 -1
- package/lib/typescript/src/features/browser.d.ts +2 -2
- package/lib/typescript/src/features/favorites.d.ts +13 -10
- package/lib/typescript/src/features/favorites.d.ts.map +1 -1
- package/lib/typescript/src/features/playback/controls.d.ts +4 -2
- package/lib/typescript/src/features/playback/controls.d.ts.map +1 -1
- package/lib/typescript/src/features/playback/state.d.ts +2 -3
- package/lib/typescript/src/features/playback/state.d.ts.map +1 -1
- package/lib/typescript/src/features/playback/trackPlaybackTime.d.ts +1 -1
- package/lib/typescript/src/features/playback/trackPlaybackTime.d.ts.map +1 -1
- package/lib/typescript/src/features/player/options.d.ts +21 -19
- package/lib/typescript/src/features/player/options.d.ts.map +1 -1
- package/lib/typescript/src/features/player/setup.d.ts.map +1 -1
- package/lib/typescript/src/features/player/validateOptions.d.ts +1 -8
- package/lib/typescript/src/features/player/validateOptions.d.ts.map +1 -1
- package/lib/typescript/src/features/queue/activeTrack.d.ts +8 -1
- package/lib/typescript/src/features/queue/activeTrack.d.ts.map +1 -1
- package/lib/typescript/src/features/queue/queue.d.ts +5 -2
- package/lib/typescript/src/features/queue/queue.d.ts.map +1 -1
- package/lib/typescript/src/types/browser-native.d.ts +2 -2
- package/lib/typescript/src/types/browser-native.d.ts.map +1 -1
- package/lib/typescript/src/types/browser-nodes.d.ts +260 -127
- package/lib/typescript/src/types/browser-nodes.d.ts.map +1 -1
- package/lib/typescript/src/types/browser.d.ts +33 -53
- package/lib/typescript/src/types/browser.d.ts.map +1 -1
- package/lib/typescript/src/utils/LazyNativeEmitter.d.ts +16 -17
- package/lib/typescript/src/utils/LazyNativeEmitter.d.ts.map +1 -1
- package/lib/typescript/src/utils/NativeUpdatedValue.d.ts +24 -19
- package/lib/typescript/src/utils/NativeUpdatedValue.d.ts.map +1 -1
- package/lib/typescript/src/utils/getTrackIdentity.d.ts +18 -0
- package/lib/typescript/src/utils/getTrackIdentity.d.ts.map +1 -0
- package/lib/typescript/src/utils/useNativeValueRefreshedBy.d.ts +21 -0
- package/lib/typescript/src/utils/useNativeValueRefreshedBy.d.ts.map +1 -0
- package/nitrogen/generated/android/AudioBrowser+autolinking.cmake +0 -1
- package/nitrogen/generated/android/c++/{JFavoritesMatchMode.hpp → JArtworkRendering.hpp} +15 -15
- package/nitrogen/generated/android/c++/JArtworkRequestConfig.hpp +4 -3
- package/nitrogen/generated/android/c++/JBrowseResult.hpp +10 -4
- package/nitrogen/generated/android/c++/JCarPlayPlayingIndicatorLocation.hpp +58 -0
- package/nitrogen/generated/android/c++/JFavoriteChangedEvent.hpp +4 -3
- package/nitrogen/generated/android/c++/JFormatNowPlayingParams.hpp +4 -3
- package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_RequestConfig___Track.hpp +4 -3
- package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__optional_NowPlayingUpdate____FormatNowPlayingParams.hpp +4 -3
- package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__optional_std__string____Track.hpp +4 -3
- package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_RequestConfig_____Track.hpp +4 -3
- package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__vector_Track______SearchParams.hpp +4 -2
- package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_void_____TrackLoadEvent.hpp +4 -2
- package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__variant_ResolvedTrack__BrowseError__std__shared_ptr_Promise_std__variant_ResolvedTrack__BrowseError_______BrowserSourceCallbackParam.hpp +10 -4
- package/nitrogen/generated/android/c++/JFunc_void_FavoriteChangedEvent.hpp +4 -3
- package/nitrogen/generated/android/c++/JFunc_void_Options.hpp +2 -5
- package/nitrogen/generated/android/c++/JFunc_void_PlaybackActiveTrackChangedEvent.hpp +4 -3
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_ResolvedTrack_.hpp +9 -3
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_Track_.hpp +4 -2
- package/nitrogen/generated/android/c++/JHybridAudioBrowserSpec.cpp +21 -14
- package/nitrogen/generated/android/c++/JIOSOptions.hpp +9 -3
- package/nitrogen/generated/android/c++/JMediaRequestConfig.hpp +4 -3
- package/nitrogen/generated/android/c++/JNativeBrowserConfiguration.hpp +16 -10
- package/nitrogen/generated/android/c++/JNativeRouteEntry.hpp +8 -2
- package/nitrogen/generated/android/c++/JNativeSetupPlayerOptions.hpp +6 -7
- package/nitrogen/generated/android/c++/JNativeUpdateOptions.hpp +2 -5
- package/nitrogen/generated/android/c++/JNitroIOSUpdateOptions.hpp +9 -3
- package/nitrogen/generated/android/c++/JOptions.hpp +2 -5
- package/nitrogen/generated/android/c++/JPlaybackActiveTrackChangedEvent.hpp +4 -3
- package/nitrogen/generated/android/c++/JPlayerCapabilities.hpp +5 -11
- package/nitrogen/generated/android/c++/JResolvedTrack.hpp +49 -51
- package/nitrogen/generated/android/c++/JSection.hpp +114 -0
- package/nitrogen/generated/android/c++/JSectionStyle.hpp +69 -0
- package/nitrogen/generated/android/c++/JStyleDisplay.hpp +58 -0
- package/nitrogen/generated/android/c++/JTrack.hpp +19 -48
- package/nitrogen/generated/android/c++/JTrackLoadEvent.hpp +4 -2
- package/nitrogen/generated/android/c++/JTrackStyle.hpp +25 -18
- package/nitrogen/generated/android/c++/JVariant_ResolvedTrack_BrowseError_Promise_BrowseResult_.hpp +10 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/{FavoritesMatchMode.kt → ArtworkRendering.kt} +5 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/CarPlayPlayingIndicatorLocation.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/IOSOptions.kt +6 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/NativeBrowserConfiguration.kt +5 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/NitroIOSUpdateOptions.kt +6 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/PlayerCapabilities.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/ResolvedTrack.kt +12 -18
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/Section.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/{FavoriteConfig.kt → SectionStyle.kt} +12 -6
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/StyleDisplay.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/Track.kt +6 -15
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/TrackStyle.kt +23 -5
- package/nitrogen/generated/ios/AudioBrowser-Swift-Cxx-Bridge.hpp +104 -82
- package/nitrogen/generated/ios/AudioBrowser-Swift-Cxx-Umbrella.hpp +16 -10
- package/nitrogen/generated/ios/c++/HybridAudioBrowserSpecSwift.hpp +16 -10
- package/nitrogen/generated/ios/swift/ArtworkRendering.swift +40 -0
- package/nitrogen/generated/ios/swift/CarPlayPlayingIndicatorLocation.swift +40 -0
- package/nitrogen/generated/ios/swift/IOSOptions.swift +7 -2
- package/nitrogen/generated/ios/swift/NativeBrowserConfiguration.swift +5 -5
- package/nitrogen/generated/ios/swift/NitroIOSUpdateOptions.swift +12 -1
- package/nitrogen/generated/ios/swift/PlayerCapabilities.swift +8 -27
- package/nitrogen/generated/ios/swift/ResolvedTrack.swift +54 -83
- package/nitrogen/generated/ios/swift/Section.swift +100 -0
- package/nitrogen/generated/ios/swift/SectionStyle.swift +64 -0
- package/nitrogen/generated/ios/swift/StyleDisplay.swift +40 -0
- package/nitrogen/generated/ios/swift/Track.swift +20 -73
- package/nitrogen/generated/ios/swift/TrackStyle.swift +28 -22
- package/nitrogen/generated/shared/c++/{FavoritesMatchMode.hpp → ArtworkRendering.hpp} +17 -17
- package/nitrogen/generated/shared/c++/CarPlayPlayingIndicatorLocation.hpp +76 -0
- package/nitrogen/generated/shared/c++/IOSOptions.hpp +9 -2
- package/nitrogen/generated/shared/c++/NativeBrowserConfiguration.hpp +6 -6
- package/nitrogen/generated/shared/c++/NitroIOSUpdateOptions.hpp +9 -2
- package/nitrogen/generated/shared/c++/PlayerCapabilities.hpp +6 -9
- package/nitrogen/generated/shared/c++/ResolvedTrack.hpp +30 -38
- package/nitrogen/generated/shared/c++/Section.hpp +106 -0
- package/nitrogen/generated/shared/c++/SectionStyle.hpp +96 -0
- package/nitrogen/generated/shared/c++/StyleDisplay.hpp +76 -0
- package/nitrogen/generated/shared/c++/Track.hpp +15 -31
- package/nitrogen/generated/shared/c++/TrackStyle.hpp +50 -34
- package/package.json +3 -2
- package/src/AudioBrowser.ts +1 -0
- package/src/features/browser-config.test.ts +21 -6
- package/src/features/browser-config.ts +11 -8
- package/src/features/browser.test.ts +1 -1
- package/src/features/browser.ts +2 -2
- package/src/features/favorites.ts +13 -10
- package/src/features/hook-wiring.test.ts +63 -15
- package/src/features/playback/controls.ts +4 -2
- package/src/features/playback/state.ts +2 -3
- package/src/features/playback/trackPlaybackTime.ts +1 -1
- package/src/features/player/options.ts +27 -19
- package/src/features/player/setup.test.ts +12 -3
- package/src/features/player/setup.ts +3 -1
- package/src/features/player/validateOptions.ts +2 -0
- package/src/features/queue/activeTrack.ts +14 -3
- package/src/features/queue/queue.ts +11 -4
- package/src/nitro-stub-drift.test.ts +277 -0
- package/src/public-surface.test.ts +40 -0
- package/src/specs/audio-browser.nitro.ts +4 -3
- package/src/style-resolution.test.ts +139 -0
- package/src/types/browser-native.ts +2 -2
- package/src/types/browser-nodes.ts +268 -136
- package/src/types/browser.ts +34 -55
- package/src/utils/LazyNativeEmitter.ts +20 -10
- package/src/utils/NativeUpdatedValue.ts +29 -13
- package/src/utils/getTrackIdentity.ts +20 -0
- package/src/utils/useNativeValueRefreshedBy.ts +38 -0
- package/src/web/NativeAudioBrowser.ts +37 -22
- package/src/web/browser/BrowserManager.ts +176 -95
- package/src/web/browser/FavoriteManager.test.ts +84 -0
- package/src/web/browser/FavoriteManager.ts +28 -23
- package/src/web/browser/assertBrowsePageShape.test.ts +1 -1
- package/src/web/browser/assertBrowsePageShape.ts +5 -3
- package/src/web/browser/classifyTrackNavigation.test.ts +10 -8
- package/src/web/browser/classifyTrackNavigation.ts +9 -9
- package/src/web/browser/parseSearchResponse.test.ts +8 -2
- package/src/web/browser/sections.test.ts +91 -0
- package/src/web/browser/sections.ts +72 -0
- package/src/web/player/NowPlayingManager.ts +4 -3
- package/src/web/util/BrowserPathHelper.test.ts +52 -0
- package/src/web/util/BrowserPathHelper.ts +61 -13
- package/ios/CarPlay/ImageRowItem+CarPlay.swift +0 -19
- package/nitrogen/generated/android/c++/JFavoriteConfig.hpp +0 -58
- package/nitrogen/generated/android/c++/JImageRowItem.hpp +0 -105
- package/nitrogen/generated/android/c++/JVariant_Boolean_FavoriteConfig.cpp +0 -26
- package/nitrogen/generated/android/c++/JVariant_Boolean_FavoriteConfig.hpp +0 -71
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/ImageRowItem.kt +0 -68
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/Variant_Boolean_FavoriteConfig.kt +0 -53
- package/nitrogen/generated/ios/swift/FavoriteConfig.swift +0 -29
- package/nitrogen/generated/ios/swift/FavoritesMatchMode.swift +0 -40
- package/nitrogen/generated/ios/swift/ImageRowItem.swift +0 -195
- package/nitrogen/generated/ios/swift/Variant_Bool_FavoriteConfig.swift +0 -18
- package/nitrogen/generated/shared/c++/FavoriteConfig.hpp +0 -84
- package/nitrogen/generated/shared/c++/ImageRowItem.hpp +0 -129
|
@@ -1,6 +1,119 @@
|
|
|
1
1
|
import type { CarPlaySiriListButtonPosition, HttpMethod } from './browser'
|
|
2
2
|
|
|
3
|
-
|
|
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 style declaration block a {@link Track} may carry: *inherited item
|
|
30
|
+
* properties* (resolved `track ?? section ?? page ?? default`, per
|
|
31
|
+
* property — they travel with the track) plus the *positional*
|
|
32
|
+
* {@link TrackStyle.display} (each holder's own children; never
|
|
33
|
+
* inherited).
|
|
34
|
+
*
|
|
35
|
+
* Rules governing every property:
|
|
36
|
+
*
|
|
37
|
+
* - **Declarations are aspirational.** Each surface renders the
|
|
38
|
+
* properties it understands and ignores the rest — inert, never an
|
|
39
|
+
* error.
|
|
40
|
+
* - **Presentation only.** No style property affects queue scope,
|
|
41
|
+
* playback, or navigation: rendering may truncate what is visible, it
|
|
42
|
+
* never changes what plays. (This is why {@link Track.disabled} is NOT
|
|
43
|
+
* here — it carries behavior, so it lives on Track as a content fact.)
|
|
44
|
+
* - **The inheritance boundary**: a handle's block styles the handle; a
|
|
45
|
+
* page's block is inherited by the page's descendants; nothing
|
|
46
|
+
* inherits across resolution.
|
|
47
|
+
*/
|
|
48
|
+
export interface TrackStyle {
|
|
49
|
+
/**
|
|
50
|
+
* How this entity's *children* lay out. The meaning is uniform at
|
|
51
|
+
* every position; only the children differ:
|
|
52
|
+
*
|
|
53
|
+
* - On a {@link Section}: the section's children.
|
|
54
|
+
* - On a resolved page ({@link ResolvedTrack.style}): the declaration
|
|
55
|
+
* for the whole page — a section overrides it for its own children.
|
|
56
|
+
* - On a browsable {@link Track} (the handle): the *advertised*
|
|
57
|
+
* layout of the page it opens. Android Auto decides a page's
|
|
58
|
+
* layout before resolving it, so it is the one reader that acts
|
|
59
|
+
* on the handle's declaration. Declared or it doesn't exist: no
|
|
60
|
+
* value → nothing advertised. The resolved page is the truth.
|
|
61
|
+
* - On a track rendered *playable* (`src` wins the rendering): inert —
|
|
62
|
+
* playables open no page.
|
|
63
|
+
*
|
|
64
|
+
* Never *item*-inherited — each holder speaks only for its own
|
|
65
|
+
* children. Between containers it resolves by scope override, not
|
|
66
|
+
* inheritance: the page declares for its whole scope, a section
|
|
67
|
+
* overrides for its own children.
|
|
68
|
+
*
|
|
69
|
+
* @default 'list'
|
|
70
|
+
*
|
|
71
|
+
* @see https://developer.android.com/training/cars/media/create-media-browser/content-styles
|
|
72
|
+
*/
|
|
73
|
+
display?: StyleDisplay
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Inherited (`track ?? section ?? page`): how this item's artwork is
|
|
77
|
+
* rendered — `'stencil'` tints a monochrome glyph to the surface's
|
|
78
|
+
* light/dark appearance.
|
|
79
|
+
*
|
|
80
|
+
* @default 'original'
|
|
81
|
+
*
|
|
82
|
+
* @platform carplay
|
|
83
|
+
*/
|
|
84
|
+
artworkRendering?: ArtworkRendering
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* A {@link Section}'s (or resolved page's) style declaration block: the
|
|
89
|
+
* *container* properties below, plus — via `extends` — a section-wide
|
|
90
|
+
* value for every inherited {@link TrackStyle} item property (and the
|
|
91
|
+
* section's own positional `display`).
|
|
92
|
+
*
|
|
93
|
+
* Container properties resolve by scope override, not inheritance: the
|
|
94
|
+
* page declares for its whole scope, a section overrides for its own
|
|
95
|
+
* children (`section ?? page ?? default`) — they never flow to items.
|
|
96
|
+
*/
|
|
97
|
+
export interface SectionStyle extends TrackStyle {
|
|
98
|
+
/**
|
|
99
|
+
* Whether grid tiles wrap to multiple lines. `false` renders exactly
|
|
100
|
+
* one line — the teaser shelf: a preview of a larger collection,
|
|
101
|
+
* typically paired with {@link Section.path} as the "view all" target.
|
|
102
|
+
*
|
|
103
|
+
* Rendered by CarPlay (a single line of tiles). Android Auto has no
|
|
104
|
+
* single-line tile container — its grid wraps, showing more, never
|
|
105
|
+
* less. Phone UIs typically honor `false` as a horizontal scroller.
|
|
106
|
+
*
|
|
107
|
+
* Inert unless {@link TrackStyle.display} is `'grid'`.
|
|
108
|
+
*
|
|
109
|
+
* @default true
|
|
110
|
+
*
|
|
111
|
+
* @platform carplay
|
|
112
|
+
*
|
|
113
|
+
* @see https://developer.apple.com/documentation/carplay/cplistimagerowitem
|
|
114
|
+
*/
|
|
115
|
+
gridWrap?: boolean
|
|
116
|
+
}
|
|
4
117
|
|
|
5
118
|
/**
|
|
6
119
|
* Image source for React Native's `<Image>` component.
|
|
@@ -37,12 +150,6 @@ export interface TrackRequest {
|
|
|
37
150
|
query?: Record<string, string>
|
|
38
151
|
}
|
|
39
152
|
|
|
40
|
-
// export interface BrowserSection {
|
|
41
|
-
// title: string
|
|
42
|
-
// style?: BrowserItemStyle
|
|
43
|
-
// children: Track
|
|
44
|
-
// }
|
|
45
|
-
|
|
46
153
|
/**
|
|
47
154
|
* Artwork URLs for a track that ships a different image per appearance.
|
|
48
155
|
*
|
|
@@ -67,66 +174,72 @@ export interface ArtworkVariants {
|
|
|
67
174
|
/** A single artwork URL, or one per appearance. */
|
|
68
175
|
export type TrackArtwork = string | ArtworkVariants
|
|
69
176
|
|
|
70
|
-
|
|
177
|
+
/**
|
|
178
|
+
* A titled, styled group of Tracks within a resolved page — the unit of
|
|
179
|
+
* queue scope. Tapping a playable child queues the section it sits in,
|
|
180
|
+
* identically on every platform and screen width: rendering may truncate
|
|
181
|
+
* what is visible, it never changes what plays.
|
|
182
|
+
*/
|
|
183
|
+
export interface Section {
|
|
184
|
+
/** Header text. Absent = headerless group. */
|
|
185
|
+
title?: string
|
|
71
186
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
187
|
+
* Secondary line for the section's navigation surface — e.g. the label
|
|
188
|
+
* of the "view all" link a tile section gets on Android Auto.
|
|
74
189
|
*/
|
|
75
|
-
|
|
76
|
-
/** Navigation path. Tapping this thumbnail navigates to this URL. */
|
|
77
|
-
url?: string
|
|
190
|
+
subtitle?: string
|
|
78
191
|
/**
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
192
|
+
* Presentation, separated from content. Each surface renders the
|
|
193
|
+
* declared layout's nearest supported form; on CarPlay
|
|
194
|
+
* a wrapping grid requires iOS 26+ and renders a list before that,
|
|
195
|
+
* since CarPlay's only earlier tile container truncates at a width the
|
|
196
|
+
* system doesn't report. Use the artwork `resolve` hook to supply
|
|
197
|
+
* fallback art for tile layouts.
|
|
82
198
|
*/
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
|
199
|
+
style?: SectionStyle
|
|
200
|
+
/**
|
|
201
|
+
* Navigation target for the section header / "view all" surface. A
|
|
202
|
+
* tile section's header tap (CarPlay) and appended "view all" link
|
|
203
|
+
* (Android Auto) navigate here. Absent = a pure preview; the header is
|
|
204
|
+
* not tappable.
|
|
205
|
+
*/
|
|
206
|
+
path?: string
|
|
207
|
+
/** The section's tracks. */
|
|
208
|
+
children: Track[]
|
|
100
209
|
}
|
|
101
210
|
|
|
211
|
+
/**
|
|
212
|
+
* The one node type of the browse tree — every tab, folder, station,
|
|
213
|
+
* episode, and queue item is a Track. What a Track *is* follows from which
|
|
214
|
+
* address fields it carries: a {@link path} makes it **browsable** (it opens
|
|
215
|
+
* as a page), a {@link src} makes it **playable** (it can be loaded into the
|
|
216
|
+
* player); at least one of the two is required. The remaining fields are
|
|
217
|
+
* display metadata ({@link title}, {@link artist}, {@link artwork}, …) and
|
|
218
|
+
* content state ({@link favorited}, {@link live}, {@link disabled}).
|
|
219
|
+
*/
|
|
102
220
|
export interface Track {
|
|
103
221
|
/**
|
|
104
222
|
* Opaque, stable identifier for this track.
|
|
105
223
|
*
|
|
224
|
+
* A track's **identity** is `id` when set (non-blank), falling back to
|
|
225
|
+
* `src`. That single rule drives every comparison the library makes:
|
|
226
|
+
* favorites matching (`setFavorites`), the CarPlay / Android Auto
|
|
227
|
+
* "now playing" row indicator, section scoping and skip-in-place, and the
|
|
228
|
+
* contextual queue re-expansion. Two tracks refer to the same item iff
|
|
229
|
+
* their identities are equal — so set `id` consistently on every surface,
|
|
230
|
+
* or on none.
|
|
231
|
+
*
|
|
106
232
|
* The library never parses or derives anything from this value — it is
|
|
107
|
-
* round-tripped verbatim through `setQueue`, `getActiveTrack`, the queue,
|
|
108
|
-
* `onActiveTrackChanged`,
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
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.
|
|
233
|
+
* round-tripped verbatim through `setQueue`, `getActiveTrack`, the queue,
|
|
234
|
+
* `onActiveTrackChanged`, and `onFavoriteChanged`, and handed to the
|
|
235
|
+
* per-track `MediaRequestConfig.resolve` / `ArtworkRequestConfig.resolve`
|
|
236
|
+
* hooks so requests can be built from the stable id.
|
|
237
|
+
*
|
|
238
|
+
* Optional: consumers whose `src` strings are identical wherever the same
|
|
239
|
+
* item appears can ignore it — their identity is the `src`. Assign ids when
|
|
240
|
+
* `src` strings for the same item can differ between surfaces (absolute vs
|
|
241
|
+
* relative URLs, volatile query params), or when favorites are stored as an
|
|
242
|
+
* identifier that isn't the playable URL.
|
|
130
243
|
*/
|
|
131
244
|
id?: string
|
|
132
245
|
|
|
@@ -134,9 +247,13 @@ export interface Track {
|
|
|
134
247
|
* Navigation path. When present, this track is a container (tab, album, playlist, folder)
|
|
135
248
|
* that can be navigated into to view its contents.
|
|
136
249
|
*
|
|
137
|
-
* At least one of `
|
|
250
|
+
* At least one of `path` or `src` must be defined. When both are set, current
|
|
251
|
+
* surfaces treat the track as playable — `src` wins the rendering, and the
|
|
252
|
+
* browse pipeline replaces a playable track's `path` with its contextual
|
|
253
|
+
* path — so a consumer-supplied `path` on a playable track is not reachable
|
|
254
|
+
* today.
|
|
138
255
|
*/
|
|
139
|
-
|
|
256
|
+
path?: string
|
|
140
257
|
|
|
141
258
|
/**
|
|
142
259
|
* Direct audio source identifier. When present, this track can be played directly.
|
|
@@ -145,7 +262,7 @@ export interface Track {
|
|
|
145
262
|
* any string (file path, custom identifier, etc.) that will be passed to
|
|
146
263
|
* MediaRequestConfig.resolve to transform it into the actual media request.
|
|
147
264
|
*
|
|
148
|
-
* At least one of `
|
|
265
|
+
* At least one of `path` or `src` must be defined.
|
|
149
266
|
*/
|
|
150
267
|
src?: string
|
|
151
268
|
|
|
@@ -159,7 +276,8 @@ export interface Track {
|
|
|
159
276
|
* Pass an {@link ArtworkVariants} pair to supply genuinely different images
|
|
160
277
|
* per appearance — a logo that changes colour, say. For a monochrome glyph
|
|
161
278
|
* that only needs recolouring, prefer a single URL plus
|
|
162
|
-
* {
|
|
279
|
+
* `style: { artworkRendering: 'stencil' }`, which is one fetch instead
|
|
280
|
+
* of two.
|
|
163
281
|
*
|
|
164
282
|
* **iOS:** supports {@link https://developer.apple.com/sf-symbols/ | SF Symbols}
|
|
165
283
|
* with the `sf:` prefix and optional color params:
|
|
@@ -189,23 +307,6 @@ export interface Track {
|
|
|
189
307
|
/** Per-track media-request override; merged last (request → media → track.request). */
|
|
190
308
|
request?: TrackRequest
|
|
191
309
|
|
|
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
310
|
// type?: TrackType
|
|
210
311
|
/** Primary line shown for this item, in both browse lists and now-playing. */
|
|
211
312
|
title: string
|
|
@@ -231,9 +332,9 @@ export interface Track {
|
|
|
231
332
|
|
|
232
333
|
/**
|
|
233
334
|
* Browse path the {@link album} line navigates to (same path namespace as
|
|
234
|
-
* {@link
|
|
335
|
+
* {@link path}). On CarPlay, when the active track has an `albumPath`, its
|
|
235
336
|
* album line on the Now Playing screen becomes tappable and navigates the
|
|
236
|
-
* browse stack there. See also `
|
|
337
|
+
* browse stack there. See also `resolveAlbumPath` in the browser
|
|
237
338
|
* configuration for a dynamic fallback.
|
|
238
339
|
*
|
|
239
340
|
* Requires {@link album} to be set: CarPlay renders the tappable line from
|
|
@@ -241,10 +342,28 @@ export interface Track {
|
|
|
241
342
|
*
|
|
242
343
|
* @platform ios
|
|
243
344
|
*/
|
|
244
|
-
|
|
345
|
+
albumPath?: string
|
|
245
346
|
|
|
347
|
+
/**
|
|
348
|
+
* Album name, shown on now-playing surfaces that have an album slot
|
|
349
|
+
* (CarPlay, Android Auto, Bluetooth metadata — the iOS lock screen has
|
|
350
|
+
* none). With {@link albumPath} set, CarPlay renders it as a tappable
|
|
351
|
+
* line that navigates there.
|
|
352
|
+
*/
|
|
246
353
|
album?: string
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Longer free-form text about the item, passed to the platform's
|
|
357
|
+
* description metadata slot where one exists. Not shown on browse rows
|
|
358
|
+
* (those render {@link title} / {@link subtitle}) or the lock screen.
|
|
359
|
+
*/
|
|
247
360
|
description?: string
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Genre name, passed to the platform's genre metadata slot where one
|
|
364
|
+
* exists. Catalog metadata only — the library never matches search or
|
|
365
|
+
* browse against it.
|
|
366
|
+
*/
|
|
248
367
|
genre?: string
|
|
249
368
|
|
|
250
369
|
/**
|
|
@@ -255,30 +374,31 @@ export interface Track {
|
|
|
255
374
|
duration?: number
|
|
256
375
|
|
|
257
376
|
/**
|
|
258
|
-
*
|
|
259
|
-
* -
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
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
|
|
377
|
+
* The track's style declaration block: inherited item properties (a
|
|
378
|
+
* per-item override of section/page values — they travel with the
|
|
379
|
+
* track), plus the positional {@link TrackStyle.display} — on a
|
|
380
|
+
* browsable track, the advertised layout of the page it opens, read
|
|
381
|
+
* by Android Auto, which picks a page's layout before resolving it.
|
|
268
382
|
*/
|
|
269
383
|
style?: TrackStyle
|
|
270
384
|
|
|
271
385
|
/**
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
*
|
|
386
|
+
* Unavailable — a content-state fact beside `favorited` and `live`,
|
|
387
|
+
* with full behavioral weight (content facts may carry behavior; style
|
|
388
|
+
* never does): a disabled track never plays — tap refused, queue
|
|
389
|
+
* expansion excludes it, voice search won't match it.
|
|
390
|
+
*
|
|
391
|
+
* Rendering ladder, never a trap: **grayed + inert** where the surface
|
|
392
|
+
* can draw it (CarPlay) → **hidden** where it can't (Android Auto) —
|
|
393
|
+
* never a normal-looking dead control. Hiding is behavior-safe because
|
|
394
|
+
* the track is inert everywhere regardless; the cost is losing the
|
|
395
|
+
* "Available at 9 PM" tease on surfaces that hide, so put the reason
|
|
396
|
+
* in the title for the ones that gray. Applied at page (re-)serve,
|
|
397
|
+
* like style.
|
|
398
|
+
*
|
|
399
|
+
* @default false
|
|
280
400
|
*/
|
|
281
|
-
|
|
401
|
+
disabled?: boolean
|
|
282
402
|
|
|
283
403
|
/**
|
|
284
404
|
* Whether this track is favorited. When the `favorite` capability is enabled,
|
|
@@ -287,40 +407,31 @@ export interface Track {
|
|
|
287
407
|
favorited?: boolean
|
|
288
408
|
|
|
289
409
|
/**
|
|
290
|
-
*
|
|
291
|
-
*
|
|
292
|
-
*
|
|
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.
|
|
410
|
+
* Declares this track a live broadcast rather than a file. The players
|
|
411
|
+
* detect *transport* liveness (sliding windows, buffering) themselves;
|
|
412
|
+
* this declaration drives the semantic decisions they can't infer:
|
|
305
413
|
*
|
|
306
|
-
* -
|
|
307
|
-
*
|
|
308
|
-
* -
|
|
309
|
-
*
|
|
414
|
+
* - **End of stream** (iOS): a live track "ending" is judged a dropped
|
|
415
|
+
* broadcast and recovered by rejoining the edge, never a queue advance.
|
|
416
|
+
* - **Stall recovery** (iOS): a live track that runs dry reconnects at
|
|
417
|
+
* the edge; a non-live one resumes its existing connection.
|
|
418
|
+
* - **`seekToLiveEdge()`** (all platforms): the call only acts on a
|
|
419
|
+
* track declared live — without the declaration it is a no-op.
|
|
420
|
+
* - **Persistence** (iOS): no position is stored, so a cold-start resume
|
|
421
|
+
* rejoins the current broadcast instead of seeking a stale timestamp.
|
|
422
|
+
* - **Now-playing** (iOS): the live indicator and live-style
|
|
423
|
+
* (non-scrubbing) progress UI.
|
|
310
424
|
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
425
|
+
* The iOS-heavy list is deliberate, not a gap: on Android, ExoPlayer's
|
|
426
|
+
* own classification already covers these — a dropped live connection
|
|
427
|
+
* surfaces as a load error (never end-of-stream), and persistence keys
|
|
428
|
+
* off its detected liveness — so the declaration's only Android reader
|
|
429
|
+
* is the `seekToLiveEdge()` gate. Android Auto has no live badge.
|
|
314
430
|
*
|
|
315
|
-
*
|
|
316
|
-
*
|
|
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`.
|
|
320
|
-
*
|
|
321
|
-
* On app side: consumable by React Native UI for horizontal thumbnail layouts.
|
|
431
|
+
* Omitting it never breaks playback — it silently breaks these judgment
|
|
432
|
+
* calls. Declare it on every live track.
|
|
322
433
|
*/
|
|
323
|
-
|
|
434
|
+
live?: boolean
|
|
324
435
|
}
|
|
325
436
|
|
|
326
437
|
/**
|
|
@@ -333,22 +444,43 @@ export interface Track {
|
|
|
333
444
|
* ```ts
|
|
334
445
|
* // navigate() is fire-and-forget (returns void); read the resolved page
|
|
335
446
|
* // from getContent() / useContent() / onContentChanged.
|
|
336
|
-
* navigate('albums/abbey-road');
|
|
447
|
+
* navigate('/albums/abbey-road');
|
|
337
448
|
* const resolved = getContent();
|
|
338
|
-
* console.log(resolved?.
|
|
449
|
+
* console.log(resolved?.path); // "/albums/abbey-road"
|
|
339
450
|
* console.log(resolved?.title); // "Abbey Road"
|
|
340
|
-
* console.log(resolved?.
|
|
451
|
+
* console.log(resolved?.sections); // the album's tracks, as sections
|
|
341
452
|
* ```
|
|
342
453
|
*/
|
|
343
454
|
export interface ResolvedTrack extends Track {
|
|
344
455
|
/**
|
|
345
|
-
*
|
|
456
|
+
* Browse path of this resolved track. Always present since you navigated to this location.
|
|
457
|
+
*/
|
|
458
|
+
path: string
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* A page is a Track that is also the container of its sections, so its
|
|
462
|
+
* block widens to {@link SectionStyle}: the declaration for the whole
|
|
463
|
+
* page. Item properties set here are inherited by every item on the
|
|
464
|
+
* page unless a section or track declares its own; the container
|
|
465
|
+
* property (`gridWrap`) and the positional `display` are the page-wide
|
|
466
|
+
* values a section overrides for its own children.
|
|
467
|
+
*/
|
|
468
|
+
style?: SectionStyle
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* The page's sections — the canonical resolved shape. Every resolved page
|
|
472
|
+
* with content carries `sections`; a page authored with plain `children`
|
|
473
|
+
* resolves to a single untitled section.
|
|
346
474
|
*/
|
|
347
|
-
|
|
475
|
+
sections?: Section[]
|
|
348
476
|
|
|
349
477
|
/**
|
|
350
|
-
*
|
|
351
|
-
*
|
|
478
|
+
* Authoring sugar for a flat page: equivalent to declaring one untitled,
|
|
479
|
+
* style-less section holding these tracks (which therefore takes the
|
|
480
|
+
* page block's scope-wide values, like any undeclared section). Accepted
|
|
481
|
+
* anywhere a page is authored (static routes, browse callbacks, JSON
|
|
482
|
+
* payloads); never populated on a *resolved* page — read `sections`
|
|
483
|
+
* instead.
|
|
352
484
|
*/
|
|
353
485
|
children?: Track[]
|
|
354
486
|
|