react-native-audio-browser 0.2.0-next.1 → 0.2.0-next.11
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 +22 -18
- package/android/build.gradle +13 -10
- package/android/gradle.properties +2 -2
- package/android/src/main/AndroidManifest.xml +3 -1
- package/android/src/main/java/com/audiobrowser/AudioBrowser.kt +76 -21
- package/android/src/main/java/com/audiobrowser/AudioBrowserLifecycleModule.kt +38 -0
- package/android/src/main/java/com/audiobrowser/AudioBrowserPackage.kt +18 -2
- package/android/src/main/java/com/audiobrowser/ServiceBinding.kt +48 -0
- package/android/src/main/java/com/audiobrowser/browser/BrowserManager.kt +1 -2
- package/android/src/main/java/com/audiobrowser/browser/BrowserUrlResolution.kt +1 -2
- package/android/src/main/java/com/audiobrowser/browser/SectionScope.kt +6 -7
- package/android/src/main/java/com/audiobrowser/http/HttpClient.kt +20 -3
- package/android/src/main/java/com/audiobrowser/model/PlayerUpdateOptions.kt +11 -11
- package/android/src/main/java/com/audiobrowser/player/CapabilityControls.kt +111 -58
- package/android/src/main/java/com/audiobrowser/player/MediaSessionCallback.kt +9 -5
- package/android/src/main/java/com/audiobrowser/player/MediaSessionCommandManager.kt +218 -252
- package/android/src/main/java/com/audiobrowser/player/NowPlayingUpdater.kt +0 -1
- package/android/src/main/java/com/audiobrowser/player/PlaybackStateStore.kt +2 -4
- package/android/src/main/java/com/audiobrowser/player/Player.kt +30 -8
- package/android/src/main/java/com/audiobrowser/player/RetryLoadErrorHandlingPolicy.kt +2 -1
- package/android/src/main/java/com/audiobrowser/player/TransformingDataSource.kt +2 -1
- package/android/src/main/java/com/audiobrowser/tls/AiaCertChaser.kt +67 -11
- package/android/src/main/java/com/audiobrowser/tls/AiaChasingExtendedTrustManager.kt +168 -0
- package/android/src/main/java/com/audiobrowser/tls/AiaChasingTrustManager.kt +58 -14
- package/android/src/main/java/com/audiobrowser/tls/AiaTls.kt +35 -7
- package/android/src/main/java/com/audiobrowser/tls/CachingCertificateFetcher.kt +278 -59
- package/android/src/main/java/com/audiobrowser/util/ArtworkVariant.kt +7 -9
- package/android/src/main/java/com/audiobrowser/util/TrackFactory.kt +8 -7
- package/android/src/test/java/com/audiobrowser/ServiceBindingTest.kt +87 -0
- package/android/src/test/java/com/audiobrowser/TestFixtures.kt +52 -1
- package/android/src/test/java/com/audiobrowser/browser/BrowserManagerLayerResolutionTest.kt +6 -0
- package/android/src/test/java/com/audiobrowser/browser/BrowserManagerTest.kt +167 -8
- package/android/src/test/java/com/audiobrowser/browser/JsonArtworkTest.kt +2 -1
- package/android/src/test/java/com/audiobrowser/browser/SectionScopeTest.kt +2 -4
- package/android/src/test/java/com/audiobrowser/player/CapabilityControlsTest.kt +100 -56
- package/android/src/test/java/com/audiobrowser/player/MediaSessionSlotMappingTest.kt +45 -0
- package/android/src/test/java/com/audiobrowser/player/PlaybackErrorClassifierTest.kt +3 -4
- package/android/src/test/java/com/audiobrowser/player/RetryLoadErrorHandlingPolicyTest.kt +3 -3
- package/android/src/test/java/com/audiobrowser/tls/AiaCertChaserTest.kt +197 -7
- package/android/src/test/java/com/audiobrowser/tls/AiaChasingTrustManagerTest.kt +325 -4
- package/android/src/test/java/com/audiobrowser/tls/CachingCertificateFetcherCallSiteTest.kt +322 -0
- package/android/src/test/java/com/audiobrowser/tls/CachingCertificateFetcherTest.kt +83 -0
- package/ios/Browser/BrowserManager.swift +2 -27
- package/ios/Browser/SearchDrillIn.swift +1 -1
- package/ios/CarPlay/RNABMediaAddHandler.swift +6 -6
- package/ios/CarPlay/RNABMediaAffinityHandler.swift +2 -2
- package/ios/CarPlay/RNABMediaIntentHandler.swift +16 -16
- package/ios/HybridAudioBrowser.swift +87 -56
- package/ios/Model/NitroTypeStubs.swift +18 -2
- package/ios/Model/RemoteCommand.swift +18 -0
- package/ios/Model/TrackPlayerError.swift +2 -2
- package/ios/Option/SessionCategories.swift +3 -2
- package/ios/Player/MediaIntentCriteria.swift +4 -4
- package/ios/Player/MediaLoader.swift +3 -1
- package/ios/Player/PlaybackCoordinator.swift +4 -1
- package/ios/Player/PlaybackErrorHandler.swift +4 -4
- package/ios/Player/QueueManager.swift +10 -3
- package/ios/Player/RetryManager.swift +79 -18
- package/ios/Player/ShuffleOrder.swift +10 -0
- package/ios/Player/SleepTimerManager.swift +43 -15
- package/ios/RemoteCommand/RemoteCommandCallbacks.swift +47 -0
- package/ios/RemoteCommand/RemoteCommandController.swift +9 -6
- package/ios/Tests/LRUCacheTests.swift +111 -0
- package/ios/Tests/LoadSeekCoordinatorTests.swift +3 -1
- package/ios/Tests/MediaIntentCriteriaTests.swift +2 -2
- package/ios/Tests/MediaLoaderTests.swift +10 -13
- package/ios/Tests/PlaybackCoordinatorTests.swift +10 -7
- package/ios/Tests/PlaybackErrorHandlerTests.swift +3 -1
- package/ios/Tests/PlayerTimeObserverTests.swift +37 -0
- package/ios/Tests/QueueManagerTests.swift +50 -4
- package/ios/Tests/RemoteCommandControllerTests.swift +156 -0
- package/ios/Tests/RemoteCommandTests.swift +67 -0
- package/ios/Tests/RetryManagerTests.swift +89 -0
- package/ios/Tests/SectionScopeTests.swift +2 -2
- package/ios/Tests/SleepTimerManagerTests.swift +22 -19
- package/ios/Tests/Support/ManualSleepTimerScheduler.swift +47 -0
- package/ios/Tests/Support/TestTypes.swift +1 -1
- package/ios/Tests/TabBarEntriesTests.swift +7 -7
- package/ios/TrackPlayer.swift +6 -1
- package/ios/TrackPlayerCallbacks.swift +5 -38
- package/ios/Util/LRUCache.swift +4 -1
- package/lib/commonjs/AudioBrowser.js +0 -11
- package/lib/commonjs/AudioBrowser.js.map +1 -1
- package/lib/commonjs/CLAUDE.md +52 -0
- package/lib/commonjs/features/browser.js +1 -1
- package/lib/commonjs/features/browser.js.map +1 -1
- package/lib/commonjs/features/carConnection.js +1 -1
- package/lib/commonjs/features/equalizer.js +1 -1
- package/lib/commonjs/features/errors.js +3 -3
- package/lib/commonjs/features/favorites.js +1 -1
- package/lib/commonjs/features/gate.js +16 -1
- package/lib/commonjs/features/gate.js.map +1 -1
- package/lib/commonjs/features/metadata.js +20 -3
- package/lib/commonjs/features/metadata.js.map +1 -1
- package/lib/commonjs/features/network.js +1 -1
- package/lib/commonjs/features/nowPlaying.js +1 -1
- package/lib/commonjs/features/output.js +1 -1
- package/lib/commonjs/features/playback/playWhenReady.js +1 -1
- package/lib/commonjs/features/playback/playing.js +1 -1
- package/lib/commonjs/features/playback/progress.js +1 -1
- package/lib/commonjs/features/playback/state.js +1 -1
- package/lib/commonjs/features/playback/trackPlaybackTime.js +0 -6
- package/lib/commonjs/features/playback/trackPlaybackTime.js.map +1 -1
- package/lib/commonjs/features/playback/volume.js +1 -1
- package/lib/commonjs/features/player/options.js +48 -34
- package/lib/commonjs/features/player/options.js.map +1 -1
- package/lib/commonjs/features/player/setup.js +15 -8
- package/lib/commonjs/features/player/setup.js.map +1 -1
- package/lib/commonjs/features/player/validateOptions.js +21 -0
- package/lib/commonjs/features/player/validateOptions.js.map +1 -0
- package/lib/commonjs/features/queue/activeTrack.js +1 -1
- package/lib/commonjs/features/queue/queue.js +2 -2
- package/lib/commonjs/features/queue/repeatMode.js +1 -1
- package/lib/commonjs/features/queue/shuffle.js +1 -1
- package/lib/commonjs/features/remoteControls.js +13 -92
- package/lib/commonjs/features/remoteControls.js.map +1 -1
- package/lib/commonjs/features/sleepTimer.js +13 -1
- package/lib/commonjs/features/sleepTimer.js.map +1 -1
- package/lib/commonjs/test-utils/reactNativeStub.js +65 -0
- package/lib/commonjs/test-utils/reactNativeStub.js.map +1 -0
- package/lib/commonjs/utils/LazyNativeEmitter.js +8 -5
- package/lib/commonjs/utils/LazyNativeEmitter.js.map +1 -1
- package/lib/commonjs/web/NativeAudioBrowser.js +1 -1
- package/lib/commonjs/web/NativeAudioBrowser.js.map +1 -1
- package/lib/commonjs/web/browser/BrowserManager.js +1 -1
- package/lib/module/AudioBrowser.js +1 -1
- package/lib/module/AudioBrowser.js.map +1 -1
- package/lib/module/CLAUDE.md +52 -0
- package/lib/module/features/browser.js +1 -1
- package/lib/module/features/browser.js.map +1 -1
- package/lib/module/features/carConnection.js +1 -1
- package/lib/module/features/equalizer.js +1 -1
- package/lib/module/features/errors.js +3 -3
- package/lib/module/features/favorites.js +1 -1
- package/lib/module/features/gate.js +16 -1
- package/lib/module/features/gate.js.map +1 -1
- package/lib/module/features/metadata.js +20 -3
- package/lib/module/features/metadata.js.map +1 -1
- package/lib/module/features/network.js +1 -1
- package/lib/module/features/nowPlaying.js +1 -1
- package/lib/module/features/output.js +1 -1
- package/lib/module/features/playback/playWhenReady.js +1 -1
- package/lib/module/features/playback/playing.js +1 -1
- package/lib/module/features/playback/progress.js +1 -1
- package/lib/module/features/playback/state.js +1 -1
- package/lib/module/features/playback/trackPlaybackTime.js +0 -5
- package/lib/module/features/playback/trackPlaybackTime.js.map +1 -1
- package/lib/module/features/playback/volume.js +1 -1
- package/lib/module/features/player/options.js +47 -32
- package/lib/module/features/player/options.js.map +1 -1
- package/lib/module/features/player/setup.js +14 -7
- package/lib/module/features/player/setup.js.map +1 -1
- package/lib/module/features/player/validateOptions.js +17 -0
- package/lib/module/features/player/validateOptions.js.map +1 -0
- package/lib/module/features/queue/activeTrack.js +1 -1
- package/lib/module/features/queue/queue.js +2 -2
- package/lib/module/features/queue/repeatMode.js +1 -1
- package/lib/module/features/queue/shuffle.js +1 -1
- package/lib/module/features/remoteControls.js +13 -92
- package/lib/module/features/remoteControls.js.map +1 -1
- package/lib/module/features/sleepTimer.js +13 -1
- package/lib/module/features/sleepTimer.js.map +1 -1
- package/lib/module/test-utils/reactNativeStub.js +58 -0
- package/lib/module/test-utils/reactNativeStub.js.map +1 -0
- package/lib/module/utils/LazyNativeEmitter.js +8 -5
- package/lib/module/utils/LazyNativeEmitter.js.map +1 -1
- package/lib/module/web/NativeAudioBrowser.js +1 -1
- package/lib/module/web/NativeAudioBrowser.js.map +1 -1
- package/lib/module/web/browser/BrowserManager.js +1 -1
- package/lib/typescript/src/AudioBrowser.d.ts +0 -1
- package/lib/typescript/src/AudioBrowser.d.ts.map +1 -1
- package/lib/typescript/src/features/carConnection.d.ts +1 -1
- package/lib/typescript/src/features/equalizer.d.ts +1 -1
- package/lib/typescript/src/features/errors.d.ts +3 -3
- package/lib/typescript/src/features/favorites.d.ts +1 -1
- package/lib/typescript/src/features/gate.d.ts +18 -2
- package/lib/typescript/src/features/gate.d.ts.map +1 -1
- package/lib/typescript/src/features/metadata.d.ts +20 -3
- package/lib/typescript/src/features/metadata.d.ts.map +1 -1
- package/lib/typescript/src/features/network.d.ts +1 -1
- package/lib/typescript/src/features/nowPlaying.d.ts +1 -1
- package/lib/typescript/src/features/output.d.ts +1 -1
- package/lib/typescript/src/features/playback/playWhenReady.d.ts +1 -1
- package/lib/typescript/src/features/playback/playing.d.ts +1 -1
- package/lib/typescript/src/features/playback/progress.d.ts +1 -1
- package/lib/typescript/src/features/playback/state.d.ts +1 -1
- package/lib/typescript/src/features/playback/volume.d.ts +1 -1
- package/lib/typescript/src/features/player/options.d.ts +87 -37
- package/lib/typescript/src/features/player/options.d.ts.map +1 -1
- package/lib/typescript/src/features/player/setup.d.ts +14 -4
- package/lib/typescript/src/features/player/setup.d.ts.map +1 -1
- package/lib/typescript/src/features/player/validateOptions.d.ts +9 -0
- package/lib/typescript/src/features/player/validateOptions.d.ts.map +1 -0
- package/lib/typescript/src/features/queue/activeTrack.d.ts +1 -1
- package/lib/typescript/src/features/queue/queue.d.ts +2 -2
- package/lib/typescript/src/features/queue/repeatMode.d.ts +1 -1
- package/lib/typescript/src/features/queue/shuffle.d.ts +1 -1
- package/lib/typescript/src/features/remoteControls.d.ts +23 -22
- package/lib/typescript/src/features/remoteControls.d.ts.map +1 -1
- package/lib/typescript/src/features/sleepTimer.d.ts +1 -1
- package/lib/typescript/src/features/sleepTimer.d.ts.map +1 -1
- package/lib/typescript/src/test-utils/reactNativeStub.d.ts +36 -0
- package/lib/typescript/src/test-utils/reactNativeStub.d.ts.map +1 -0
- package/lib/typescript/src/utils/LazyNativeEmitter.d.ts +8 -4
- package/lib/typescript/src/utils/LazyNativeEmitter.d.ts.map +1 -1
- package/nitrogen/generated/android/AudioBrowser+autolinking.cmake +1 -1
- package/nitrogen/generated/android/c++/JAndroidOptions.hpp +10 -10
- package/nitrogen/generated/android/c++/JFunc_void_Options.hpp +5 -5
- package/nitrogen/generated/android/c++/JHybridAudioBrowserSpec.cpp +11 -11
- package/nitrogen/generated/android/c++/JHybridAudioBrowserSpec.hpp +1 -1
- package/nitrogen/generated/android/c++/JNativeSetupPlayerOptions.hpp +5 -5
- package/nitrogen/generated/android/c++/JNativeUpdateOptions.hpp +5 -5
- package/nitrogen/generated/android/c++/JNitroAndroidUpdateOptions.hpp +10 -10
- package/nitrogen/generated/android/c++/JOptions.hpp +5 -5
- package/nitrogen/generated/android/c++/{JNotificationButton.hpp → JRemoteButton.hpp} +19 -19
- package/nitrogen/generated/android/c++/JRemoteButtonLayout.hpp +86 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_RemoteButtonLayout.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_RemoteButtonLayout.hpp +75 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/AndroidOptions.kt +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/HybridAudioBrowserSpec.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/NitroAndroidUpdateOptions.kt +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/{NotificationButton.kt → RemoteButton.kt} +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/RemoteButtonLayout.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/{Variant_NullType_NotificationButtonLayout.kt → Variant_NullType_RemoteButtonLayout.kt} +9 -9
- package/nitrogen/generated/ios/AudioBrowser-Swift-Cxx-Bridge.hpp +36 -51
- package/nitrogen/generated/ios/AudioBrowser-Swift-Cxx-Umbrella.hpp +6 -6
- package/nitrogen/generated/ios/c++/HybridAudioBrowserSpecSwift.hpp +8 -8
- package/nitrogen/generated/ios/swift/AndroidOptions.swift +12 -12
- package/nitrogen/generated/ios/swift/HybridAudioBrowserSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridAudioBrowserSpec_cxx.swift +2 -2
- package/nitrogen/generated/ios/swift/NitroAndroidUpdateOptions.swift +12 -12
- package/nitrogen/generated/ios/swift/{NotificationButton.swift → RemoteButton.swift} +6 -6
- package/nitrogen/generated/ios/swift/RemoteButtonLayout.swift +57 -0
- package/nitrogen/generated/ios/swift/{Variant_NullType_NotificationButtonLayout.swift → Variant_NullType_RemoteButtonLayout.swift} +3 -3
- package/nitrogen/generated/shared/c++/AndroidOptions.hpp +8 -8
- package/nitrogen/generated/shared/c++/HybridAudioBrowserSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridAudioBrowserSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/NitroAndroidUpdateOptions.hpp +8 -8
- package/nitrogen/generated/shared/c++/{NotificationButton.hpp → RemoteButton.hpp} +19 -19
- package/nitrogen/generated/shared/c++/RemoteButtonLayout.hpp +94 -0
- package/package.json +12 -4
- package/src/AudioBrowser.ts +1 -1
- package/src/CLAUDE.md +52 -0
- package/src/features/battery.test.ts +79 -0
- package/src/features/browser.ts +1 -1
- package/src/features/carConnection.ts +1 -1
- package/src/features/equalizer.ts +1 -1
- package/src/features/errors.ts +3 -3
- package/src/features/favorites.ts +1 -1
- package/src/features/gate.ts +16 -1
- package/src/features/hook-wiring.test.ts +254 -0
- package/src/features/metadata.ts +20 -3
- package/src/features/network.ts +1 -1
- package/src/features/nowPlaying.ts +1 -1
- package/src/features/output.ts +1 -1
- package/src/features/playback/playWhenReady.ts +1 -1
- package/src/features/playback/playing.ts +1 -1
- package/src/features/playback/progress.test.ts +169 -0
- package/src/features/playback/progress.ts +1 -1
- package/src/features/playback/state.ts +1 -1
- package/src/features/playback/trackPlaybackTime.test.ts +16 -6
- package/src/features/playback/trackPlaybackTime.ts +0 -5
- package/src/features/playback/volume.ts +1 -1
- package/src/features/player/options.ts +99 -57
- package/src/features/player/setup.test.ts +12 -4
- package/src/features/player/setup.ts +19 -9
- package/src/features/player/validateOptions.ts +19 -0
- package/src/features/queue/activeTrack.ts +1 -1
- package/src/features/queue/queue.ts +2 -2
- package/src/features/queue/repeatMode.ts +1 -1
- package/src/features/queue/shuffle.ts +1 -1
- package/src/features/remoteControls.ts +13 -92
- package/src/features/sleepTimer.test.ts +172 -0
- package/src/features/sleepTimer.ts +9 -1
- package/src/nitro-stub-drift.test.ts +237 -0
- package/src/public-surface.test.ts +107 -0
- package/src/specs/audio-browser.nitro.ts +1 -1
- package/src/test-utils/reactNativeStub.ts +60 -0
- package/src/utils/LazyNativeEmitter.ts +9 -6
- package/src/utils/useDebug.test.ts +182 -0
- package/src/utils/useNativeUpdatedValue.test.ts +103 -0
- package/src/web/NativeAudioBrowser.ts +1 -1
- package/src/web/browser/BrowserManager.ts +1 -1
- package/ios/Model/MediaURL.swift +0 -67
- package/nitrogen/generated/android/c++/JNotificationButtonLayout.hpp +0 -94
- package/nitrogen/generated/android/c++/JVariant_NullType_NotificationButtonLayout.cpp +0 -26
- package/nitrogen/generated/android/c++/JVariant_NullType_NotificationButtonLayout.hpp +0 -75
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/NotificationButtonLayout.kt +0 -50
- package/nitrogen/generated/ios/swift/NotificationButtonLayout.swift +0 -92
- package/nitrogen/generated/shared/c++/NotificationButtonLayout.hpp +0 -102
|
@@ -65,7 +65,8 @@ export interface PlayerCapabilities {
|
|
|
65
65
|
*
|
|
66
66
|
* Turns on the favorite/like heart across all surfaces:
|
|
67
67
|
* - iOS: Control Center + CarPlay now-playing.
|
|
68
|
-
* - Android:
|
|
68
|
+
* - Android: a place in the {@link RemoteButtonLayout} — the notification,
|
|
69
|
+
* Android Auto and the Android 13+ system media controls — and an
|
|
69
70
|
* (empty or filled) heart on playable browse rows.
|
|
70
71
|
*
|
|
71
72
|
* `match` controls how the ids from `setFavorites` are
|
|
@@ -111,48 +112,77 @@ export interface PlayerCapabilities {
|
|
|
111
112
|
playbackRate?: boolean;
|
|
112
113
|
}
|
|
113
114
|
/**
|
|
114
|
-
* Buttons that can be
|
|
115
|
-
*
|
|
115
|
+
* Buttons that can be placed in the Android button layout — the interactive
|
|
116
|
+
* controls a listener taps in the notification, on the Android Auto Now Playing
|
|
117
|
+
* screen, and in the Android 13+ system media controls.
|
|
116
118
|
*/
|
|
117
|
-
export type
|
|
119
|
+
export type RemoteButton = 'skip-to-previous' | 'skip-to-next' | 'jump-backward' | 'jump-forward' | 'favorite';
|
|
118
120
|
/**
|
|
119
|
-
*
|
|
120
|
-
* Allows explicit control over which buttons appear in which slots.
|
|
121
|
+
* Where each button sits on Android.
|
|
121
122
|
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
123
|
+
* Android offers exactly three positions, and play/pause always occupies the
|
|
124
|
+
* centre — you cannot move it, and you cannot put two buttons on the same side
|
|
125
|
+
* of it:
|
|
126
|
+
*
|
|
127
|
+
* ```
|
|
128
|
+
* back │ ▶ play/pause │ forward overflow ⋯
|
|
129
|
+
* ```
|
|
130
|
+
*
|
|
131
|
+
* - **`back`** — the single position left of play/pause
|
|
132
|
+
* - **`forward`** — the single position right of play/pause
|
|
133
|
+
* - **`overflow`** — everything else, in priority order
|
|
134
|
+
*
|
|
135
|
+
* **A layout describes the whole arrangement.** All three fields are required —
|
|
136
|
+
* there is no per-field merge with the capability defaults, so what you write is
|
|
137
|
+
* exactly what renders. Use `undefined` for an empty position and `[]` for no
|
|
138
|
+
* overflow. To go back to the derived defaults, omit `remoteButtonLayout`
|
|
139
|
+
* entirely (or set it to `null`); that is the only switch.
|
|
140
|
+
*
|
|
141
|
+
* **Overflow order is priority, not coordinates.** Each surface renders as many
|
|
142
|
+
* buttons as it has room for, taking them from the front — a phone
|
|
143
|
+
* notification, the Android 13+ system media controls, and a car head unit all
|
|
144
|
+
* have different budgets. A head unit with a spare slot may promote the first
|
|
145
|
+
* overflow entry onto the main row, and a long list gets truncated by whichever
|
|
146
|
+
* surface is showing it. Put what matters most first.
|
|
147
|
+
*
|
|
148
|
+
* Placement never changes what a control *can* do: a button left out entirely
|
|
149
|
+
* still responds to a Bluetooth remote or headset, as long as its
|
|
150
|
+
* {@link PlayerCapabilities} entry is enabled.
|
|
126
151
|
*
|
|
127
152
|
* @example
|
|
128
153
|
* ```typescript
|
|
129
|
-
* // Podcast-style: jump
|
|
130
|
-
*
|
|
154
|
+
* // Podcast-style: jump either side of play/pause
|
|
155
|
+
* remoteButtonLayout: {
|
|
131
156
|
* back: 'jump-backward',
|
|
132
157
|
* forward: 'jump-forward',
|
|
133
|
-
* overflow: ['favorite']
|
|
158
|
+
* overflow: ['skip-to-previous', 'skip-to-next', 'favorite']
|
|
134
159
|
* }
|
|
135
160
|
*
|
|
136
|
-
* // Music-style: skip
|
|
137
|
-
*
|
|
161
|
+
* // Music-style: skip either side of play/pause
|
|
162
|
+
* remoteButtonLayout: {
|
|
138
163
|
* back: 'skip-to-previous',
|
|
139
164
|
* forward: 'skip-to-next',
|
|
140
|
-
*
|
|
141
|
-
*
|
|
165
|
+
* overflow: ['favorite']
|
|
166
|
+
* }
|
|
167
|
+
*
|
|
168
|
+
* // Live radio: forward only, nothing to the left
|
|
169
|
+
* remoteButtonLayout: {
|
|
170
|
+
* back: undefined,
|
|
171
|
+
* forward: 'skip-to-next',
|
|
172
|
+
* overflow: []
|
|
142
173
|
* }
|
|
143
174
|
* ```
|
|
144
175
|
*/
|
|
145
|
-
export type
|
|
146
|
-
/**
|
|
147
|
-
back
|
|
148
|
-
/**
|
|
149
|
-
forward
|
|
150
|
-
/**
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
overflow?: NotificationButton[];
|
|
176
|
+
export type RemoteButtonLayout = {
|
|
177
|
+
/** The single position left of play/pause. `undefined` leaves it empty. */
|
|
178
|
+
back: RemoteButton | undefined;
|
|
179
|
+
/** The single position right of play/pause. `undefined` leaves it empty. */
|
|
180
|
+
forward: RemoteButton | undefined;
|
|
181
|
+
/**
|
|
182
|
+
* Everything else, most important first — surfaces promote and truncate from
|
|
183
|
+
* the front. `[]` for none.
|
|
184
|
+
*/
|
|
185
|
+
overflow: RemoteButton[];
|
|
156
186
|
};
|
|
157
187
|
/**
|
|
158
188
|
* AppKilledPlaybackBehavior options:
|
|
@@ -186,11 +216,21 @@ export interface Options {
|
|
|
186
216
|
android?: AndroidOptions;
|
|
187
217
|
/**
|
|
188
218
|
* Jump forward interval in seconds when using jump forward controls.
|
|
219
|
+
*
|
|
220
|
+
* On Android, an interval of exactly 5, 10, 15 or 30 seconds gets an icon
|
|
221
|
+
* showing that number; any other interval gets an icon without one. Other
|
|
222
|
+
* values are perfectly valid — the interval also sets the seek distance.
|
|
223
|
+
*
|
|
189
224
|
* @default 15
|
|
190
225
|
*/
|
|
191
226
|
forwardJumpInterval: number;
|
|
192
227
|
/**
|
|
193
228
|
* Jump backward interval in seconds when using jump backward controls.
|
|
229
|
+
*
|
|
230
|
+
* On Android, an interval of exactly 5, 10, 15 or 30 seconds gets an icon
|
|
231
|
+
* showing that number; any other interval gets an icon without one. Other
|
|
232
|
+
* values are perfectly valid — the interval also sets the seek distance.
|
|
233
|
+
*
|
|
194
234
|
* @default 15
|
|
195
235
|
*/
|
|
196
236
|
backwardJumpInterval: number;
|
|
@@ -245,14 +285,14 @@ export interface AndroidOptions {
|
|
|
245
285
|
*/
|
|
246
286
|
skipSilence: boolean;
|
|
247
287
|
/**
|
|
248
|
-
*
|
|
249
|
-
*
|
|
288
|
+
* Ordered button layout, applied to the notification, Android Auto, and the
|
|
289
|
+
* Android 13+ system media controls. See {@link RemoteButtonLayout}.
|
|
250
290
|
*
|
|
251
|
-
* When not specified,
|
|
291
|
+
* When not specified, the layout is derived from capabilities.
|
|
252
292
|
*
|
|
253
293
|
* @platform android
|
|
254
294
|
*/
|
|
255
|
-
|
|
295
|
+
remoteButtonLayout: RemoteButtonLayout | null;
|
|
256
296
|
}
|
|
257
297
|
export interface AndroidUpdateOptions {
|
|
258
298
|
/**
|
|
@@ -269,14 +309,14 @@ export interface AndroidUpdateOptions {
|
|
|
269
309
|
*/
|
|
270
310
|
skipSilence?: boolean;
|
|
271
311
|
/**
|
|
272
|
-
*
|
|
273
|
-
*
|
|
312
|
+
* Ordered button layout, applied to the notification, Android Auto, and the
|
|
313
|
+
* Android 13+ system media controls. See {@link RemoteButtonLayout}.
|
|
274
314
|
*
|
|
275
|
-
* When not specified,
|
|
315
|
+
* When not specified, the layout is derived from capabilities.
|
|
276
316
|
*
|
|
277
317
|
* @platform android
|
|
278
318
|
*/
|
|
279
|
-
|
|
319
|
+
remoteButtonLayout?: RemoteButtonLayout | null;
|
|
280
320
|
}
|
|
281
321
|
/**
|
|
282
322
|
* iOS-specific player options that can be changed at runtime via {@link updateOptions}.
|
|
@@ -337,11 +377,21 @@ export interface UpdateOptions {
|
|
|
337
377
|
ios?: IOSUpdateOptions;
|
|
338
378
|
/**
|
|
339
379
|
* Jump forward interval in seconds when using jump forward controls.
|
|
380
|
+
*
|
|
381
|
+
* On Android, an interval of exactly 5, 10, 15 or 30 seconds gets an icon
|
|
382
|
+
* showing that number; any other interval gets an icon without one. Other
|
|
383
|
+
* values are perfectly valid — the interval also sets the seek distance.
|
|
384
|
+
*
|
|
340
385
|
* @default 15
|
|
341
386
|
*/
|
|
342
387
|
forwardJumpInterval?: number;
|
|
343
388
|
/**
|
|
344
389
|
* Jump backward interval in seconds when using jump backward controls.
|
|
390
|
+
*
|
|
391
|
+
* On Android, an interval of exactly 5, 10, 15 or 30 seconds gets an icon
|
|
392
|
+
* showing that number; any other interval gets an icon without one. Other
|
|
393
|
+
* values are perfectly valid — the interval also sets the seek distance.
|
|
394
|
+
*
|
|
345
395
|
* @default 15
|
|
346
396
|
*/
|
|
347
397
|
backwardJumpInterval?: number;
|
|
@@ -401,7 +451,7 @@ export declare function getOptions(): Options;
|
|
|
401
451
|
/**
|
|
402
452
|
* Subscribes to player options changes.
|
|
403
453
|
* @param callback - Called when the player options change
|
|
404
|
-
* @returns
|
|
454
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
405
455
|
*/
|
|
406
456
|
export declare const onOptionsChanged: NativeUpdatedValue<Options>;
|
|
407
457
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../../src/features/player/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAElE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../../src/features/player/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAElE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAMnE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;;O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,EAAE,aAAa,GAAG,IAAI,CAG1D;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAID;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,6BAE5B,CAAA;AAID;;;GAGG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAEpC"}
|
|
@@ -15,7 +15,10 @@ import type { AndroidUpdateOptions, IOSUpdateOptions, UpdateOptions } from './op
|
|
|
15
15
|
export type FormatNowPlayingParams = {
|
|
16
16
|
/** The currently playing track. */
|
|
17
17
|
track: Track;
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Timed metadata (ICY / ID3 "now playing song") received during playback, if any.
|
|
20
|
+
* Always `undefined` on web — see `onTimedMetadata` for why.
|
|
21
|
+
*/
|
|
19
22
|
timedMetadata?: TimedMetadata;
|
|
20
23
|
/** The play/pause intent — `false` while paused. Stays `true` through buffers, so the song line won't flicker. */
|
|
21
24
|
playWhenReady: boolean;
|
|
@@ -273,7 +276,7 @@ export type RetryConfig = {
|
|
|
273
276
|
export type AndroidPlayerWakeMode = 'none' | 'local' | 'network';
|
|
274
277
|
/**
|
|
275
278
|
* Android setup options: the engine-construction fields plus the Android runtime options
|
|
276
|
-
* ({@link AndroidUpdateOptions} — `
|
|
279
|
+
* ({@link AndroidUpdateOptions} — `remoteButtonLayout`, `skipSilence`, …), all expressible at
|
|
277
280
|
* launch. The consumer never has to know which is which; `setupPlayer` routes each field to
|
|
278
281
|
* where it's applied.
|
|
279
282
|
*/
|
|
@@ -484,7 +487,7 @@ export type SetupPlayerOptions = Pick<UpdateOptions, 'capabilities' | 'forwardJu
|
|
|
484
487
|
/**
|
|
485
488
|
* Initializes the player with the specified options — the full launch description in one
|
|
486
489
|
* declarative, atomic call. Runtime options (`capabilities`, jump intervals,
|
|
487
|
-
* `
|
|
490
|
+
* `remoteButtonLayout`, …) and the initial `playWhenReady` / `repeatMode` are applied
|
|
488
491
|
* natively as part of setup itself, so there is no setup-then-command ordering for consumers
|
|
489
492
|
* to know about, and no window where the player exists without its options.
|
|
490
493
|
*
|
|
@@ -501,7 +504,14 @@ export type SetupPlayerOptions = Pick<UpdateOptions, 'capabilities' | 'forwardJu
|
|
|
501
504
|
* playWhenReady: true,
|
|
502
505
|
* repeatMode: 'queue',
|
|
503
506
|
* capabilities: { favorite: true },
|
|
504
|
-
* android: {
|
|
507
|
+
* android: {
|
|
508
|
+
* audioContentType: 'music',
|
|
509
|
+
* remoteButtonLayout: {
|
|
510
|
+
* back: 'jump-backward',
|
|
511
|
+
* forward: 'jump-forward',
|
|
512
|
+
* overflow: ['favorite']
|
|
513
|
+
* }
|
|
514
|
+
* },
|
|
505
515
|
* ios: { category: 'playback' }
|
|
506
516
|
* })
|
|
507
517
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../../../src/features/player/setup.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,EACV,oBAAoB,EACpB,gBAAgB,EAEhB,aAAa,EACd,MAAM,WAAW,CAAA;AAIlB;;;;;;;;GAQG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,mCAAmC;IACnC,KAAK,EAAE,KAAK,CAAA;IACZ
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../../../src/features/player/setup.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB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AAO,CAAA;IAElC;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,qBAAqB,CAAA;CACjC;AAED,gFAAgF;AAChF,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;OAGG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAA;IAEtB;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,eAAe,CAAA;IAE9B;;;OAGG;IACH,eAAe,CAAC,EAAE,kBAAkB,EAAE,CAAA;IAEtC;;;OAGG;IACH,cAAc,CAAC,EAAE,iBAAiB,CAAA;CACnC;AA0DD;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,aAAa,EACX,cAAc,GACd,qBAAqB,GACrB,sBAAsB,GACtB,6BAA6B,CAChC,GAAG;IACF;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,UAAU,CAAA;IAEvB;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,WAAW,CAAA;IAE7B;;;;;;;;;;OAUG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAA;IAEjC,yEAAyE;IACzE,OAAO,CAAC,EAAE,mBAAmB,CAAA;IAC7B,+DAA+D;IAC/D,GAAG,CAAC,EAAE,eAAe,CAAA;IACrB;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,wBAAwB,CAAA;CAChD,CAAA;AAiED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAsB,WAAW,CAC/B,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAyDf"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IOSUpdateOptions } from './options';
|
|
2
|
+
/**
|
|
3
|
+
* Warns when more CarPlay now-playing buttons are configured than CarPlay renders.
|
|
4
|
+
* Shared by `updateOptions` and `setupPlayer` (both can carry `ios` options).
|
|
5
|
+
* Kept out of `options.ts`, which the barrel re-exports — see
|
|
6
|
+
* public-surface.test.ts.
|
|
7
|
+
*/
|
|
8
|
+
export declare function validateIOSUpdateOptions(ios?: IOSUpdateOptions): void;
|
|
9
|
+
//# sourceMappingURL=validateOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateOptions.d.ts","sourceRoot":"","sources":["../../../../../src/features/player/validateOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAIjD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAQrE"}
|
|
@@ -27,7 +27,7 @@ export declare function getActiveTrackIndex(): number | undefined;
|
|
|
27
27
|
/**
|
|
28
28
|
* Subscribes to active track change events.
|
|
29
29
|
* @param callback - Called when the active track changes
|
|
30
|
-
* @returns
|
|
30
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
31
31
|
*/
|
|
32
32
|
export declare const onActiveTrackChanged: NativeUpdatedValue<PlaybackActiveTrackChangedEvent>;
|
|
33
33
|
/**
|
|
@@ -100,14 +100,14 @@ export declare function getQueue(): Track[];
|
|
|
100
100
|
/**
|
|
101
101
|
* Subscribes to playback queue ended events.
|
|
102
102
|
* @param callback - Called when playback has paused due to reaching the end of the queue
|
|
103
|
-
* @returns
|
|
103
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
104
104
|
*/
|
|
105
105
|
export declare const onQueueEnded: NativeUpdatedValue<PlaybackQueueEndedEvent>;
|
|
106
106
|
/**
|
|
107
107
|
* Subscribes to queue change events.
|
|
108
108
|
* Called when tracks are added, removed, reordered, or when track metadata changes.
|
|
109
109
|
* @param callback - Called with the updated queue
|
|
110
|
-
* @returns
|
|
110
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
111
111
|
*/
|
|
112
112
|
export declare const onQueueChanged: NativeUpdatedValue<Track[]>;
|
|
113
113
|
/**
|
|
@@ -23,7 +23,7 @@ export interface RepeatModeChangedEvent {
|
|
|
23
23
|
/**
|
|
24
24
|
* Subscribes to repeat mode changes.
|
|
25
25
|
* @param callback - Called when repeat mode changes
|
|
26
|
-
* @returns
|
|
26
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
27
27
|
*/
|
|
28
28
|
export declare const onRepeatModeChanged: NativeUpdatedValue<RepeatModeChangedEvent>;
|
|
29
29
|
/**
|
|
@@ -16,7 +16,7 @@ export declare function toggleShuffle(): void;
|
|
|
16
16
|
/**
|
|
17
17
|
* Subscribes to shuffle mode changes.
|
|
18
18
|
* @param callback - Called when shuffle mode changes
|
|
19
|
-
* @returns
|
|
19
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
20
20
|
*/
|
|
21
21
|
export declare const onShuffleChanged: NativeUpdatedValue<boolean>;
|
|
22
22
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LazyNativeEmitter } from '../utils/LazyNativeEmitter';
|
|
1
2
|
/**
|
|
2
3
|
* Remote jump backward event.
|
|
3
4
|
*/
|
|
@@ -85,67 +86,67 @@ export declare function handleRemoteJumpBackward(callback: ((event: RemoteJumpBa
|
|
|
85
86
|
/**
|
|
86
87
|
* Subscribes to remote jump backward events.
|
|
87
88
|
* @param callback - Called when the user presses the jump backward button
|
|
88
|
-
* @returns
|
|
89
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
89
90
|
*/
|
|
90
|
-
export declare const onRemoteJumpBackward:
|
|
91
|
+
export declare const onRemoteJumpBackward: LazyNativeEmitter<RemoteJumpBackwardEvent>;
|
|
91
92
|
/**
|
|
92
93
|
* Subscribes to remote jump forward events.
|
|
93
94
|
* @param callback - Called when the user presses the jump forward button
|
|
94
|
-
* @returns
|
|
95
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
95
96
|
*/
|
|
96
|
-
export declare const onRemoteJumpForward:
|
|
97
|
+
export declare const onRemoteJumpForward: LazyNativeEmitter<RemoteJumpForwardEvent>;
|
|
97
98
|
/**
|
|
98
99
|
* Subscribes to remote next events.
|
|
99
100
|
* @param callback - Called when the user presses the next track button
|
|
100
|
-
* @returns
|
|
101
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
101
102
|
*/
|
|
102
|
-
export declare const onRemoteNext:
|
|
103
|
+
export declare const onRemoteNext: LazyNativeEmitter<void>;
|
|
103
104
|
/**
|
|
104
105
|
* Subscribes to remote pause events.
|
|
105
106
|
* @param callback - Called when the user presses the pause button
|
|
106
|
-
* @returns
|
|
107
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
107
108
|
*/
|
|
108
|
-
export declare const onRemotePause:
|
|
109
|
+
export declare const onRemotePause: LazyNativeEmitter<void>;
|
|
109
110
|
/**
|
|
110
111
|
* Subscribes to remote play events.
|
|
111
112
|
* @param callback - Called when the user presses the play button
|
|
112
|
-
* @returns
|
|
113
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
113
114
|
*/
|
|
114
|
-
export declare const onRemotePlay:
|
|
115
|
+
export declare const onRemotePlay: LazyNativeEmitter<void>;
|
|
115
116
|
/**
|
|
116
117
|
* Subscribes to remote play ID events (Android only).
|
|
117
118
|
* @param callback - Called when the user selects a track from an external device
|
|
118
|
-
* @returns
|
|
119
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
119
120
|
*/
|
|
120
|
-
export declare const onRemotePlayId:
|
|
121
|
+
export declare const onRemotePlayId: LazyNativeEmitter<RemotePlayIdEvent>;
|
|
121
122
|
/**
|
|
122
123
|
* Subscribes to remote play search events (Android only).
|
|
123
124
|
* @param callback - Called when the user searches for a track (usually voice search)
|
|
124
|
-
* @returns
|
|
125
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
125
126
|
*/
|
|
126
|
-
export declare const onRemotePlaySearch:
|
|
127
|
+
export declare const onRemotePlaySearch: LazyNativeEmitter<RemotePlaySearchEvent>;
|
|
127
128
|
/**
|
|
128
129
|
* Subscribes to remote previous events.
|
|
129
130
|
* @param callback - Called when the user presses the previous track button
|
|
130
|
-
* @returns
|
|
131
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
131
132
|
*/
|
|
132
|
-
export declare const onRemotePrevious:
|
|
133
|
+
export declare const onRemotePrevious: LazyNativeEmitter<void>;
|
|
133
134
|
/**
|
|
134
135
|
* Subscribes to remote seek events.
|
|
135
136
|
* @param callback - Called when the user changes the position of the timeline
|
|
136
|
-
* @returns
|
|
137
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
137
138
|
*/
|
|
138
|
-
export declare const onRemoteSeek:
|
|
139
|
+
export declare const onRemoteSeek: LazyNativeEmitter<RemoteSeekEvent>;
|
|
139
140
|
/**
|
|
140
141
|
* Subscribes to remote skip events (Android only).
|
|
141
142
|
* @param callback - Called when the user presses the skip button
|
|
142
|
-
* @returns
|
|
143
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
143
144
|
*/
|
|
144
|
-
export declare const onRemoteSkip:
|
|
145
|
+
export declare const onRemoteSkip: LazyNativeEmitter<RemoteSkipEvent>;
|
|
145
146
|
/**
|
|
146
147
|
* Subscribes to remote stop events.
|
|
147
148
|
* @param callback - Called when the user presses the stop button
|
|
148
|
-
* @returns
|
|
149
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
149
150
|
*/
|
|
150
|
-
export declare const onRemoteStop:
|
|
151
|
+
export declare const onRemoteStop: LazyNativeEmitter<void>;
|
|
151
152
|
//# sourceMappingURL=remoteControls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remoteControls.d.ts","sourceRoot":"","sources":["../../../../src/features/remoteControls.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remoteControls.d.ts","sourceRoot":"","sources":["../../../../src/features/remoteControls.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAI9D;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAA;CACd;AAQD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,QAElE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,QAEnE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,QAElE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,QAEtE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,QAElE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC,GAAG,SAAS,QAGzD;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,CAAC,GAAG,SAAS,QAGhE;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC,GAAG,SAAS,QAGjE;AASD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,4CAG9B,CAAA;AAEH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,2CAG7B,CAAA;AAEH;;;;GAIG;AACH,eAAO,MAAM,YAAY,yBAExB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,yBAEzB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,yBAExB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,sCAE1B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,0CAG5B,CAAA;AAEH;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,yBAE5B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,oCAExB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,oCAExB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,yBAExB,CAAA"}
|
|
@@ -57,7 +57,7 @@ export declare function clearSleepTimer(): boolean;
|
|
|
57
57
|
/**
|
|
58
58
|
* Subscribes to sleep timer changes.
|
|
59
59
|
* @param callback - Called when the sleep timer state changes
|
|
60
|
-
* @returns
|
|
60
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
61
61
|
*/
|
|
62
62
|
export declare const onSleepTimerChanged: NativeUpdatedValue<SleepTimer>;
|
|
63
63
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sleepTimer.d.ts","sourceRoot":"","sources":["../../../../src/features/sleepTimer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAIhE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,2DAA2D;IAC3D,oBAAoB,EAAE,OAAO,CAAA;CAC9B,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,oBAAoB,GAAG,IAAI,CAAA;AAErE,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAA;AAI/C;;GAEG;AACH,wBAAgB,aAAa,IAAI,UAAU,CAE1C;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,iBAAiB,GAC1B,IAAI,CAEN;AAED;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAID;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,gCAE/B,CAAA;AAID;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"sleepTimer.d.ts","sourceRoot":"","sources":["../../../../src/features/sleepTimer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAIhE;;GAEG;AACH,MAAM,MAAM,cAAc,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
4
|
+
* Not a convenience: `react-native/index.js` is Flow-typed (`import typeof ...`)
|
|
5
|
+
* and Rollup cannot parse it, so any test that reaches a module importing from
|
|
6
|
+
* `'react-native'` fails to load at all. Jest consumers get this from
|
|
7
|
+
* `@react-native/jest-preset`; vitest has no equivalent.
|
|
8
|
+
*
|
|
9
|
+
* Keep it to the surface the library actually touches. Two symbols so far —
|
|
10
|
+
* `AppState` (usePolledProgress) and `Image.resolveAssetSource`. Anything a test
|
|
11
|
+
* needs to drive should get an explicit control here rather than a cast at the
|
|
12
|
+
* call site.
|
|
13
|
+
*
|
|
14
|
+
* @internal — never imported by production code, only aliased in by the runner.
|
|
15
|
+
*/
|
|
16
|
+
type ChangeListener = (status: AppStateStatus) => void;
|
|
17
|
+
export declare const AppState: {
|
|
18
|
+
currentState: AppStateStatus;
|
|
19
|
+
addEventListener(type: string, listener: ChangeListener): {
|
|
20
|
+
remove: () => boolean;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/** Move the app to the foreground or background and notify subscribers. */
|
|
24
|
+
export declare function setAppState(status: AppStateStatus): void;
|
|
25
|
+
/**
|
|
26
|
+
* Drop every subscription and return to the foreground. Call between tests —
|
|
27
|
+
* the stub is a module singleton, so state outlives an individual test.
|
|
28
|
+
*/
|
|
29
|
+
export declare function resetAppState(): void;
|
|
30
|
+
/** Number of live `change` subscriptions, for asserting cleanup. */
|
|
31
|
+
export declare function appStateListenerCount(): number;
|
|
32
|
+
export declare const Image: {
|
|
33
|
+
resolveAssetSource: (source: unknown) => unknown;
|
|
34
|
+
};
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=reactNativeStub.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactNativeStub.d.ts","sourceRoot":"","sources":["../../../../src/test-utils/reactNativeStub.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,KAAK,cAAc,GAAG,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAA;AAItD,eAAO,MAAM,QAAQ;IACnB,YAAY,EAAc,cAAc;IAKxC,gBAAgB,OAAO,MAAM,YAAY,cAAc;QAG5C,MAAM;;CAElB,CAAA;AAED,2EAA2E;AAC3E,wBAAgB,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAKxD;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAGpC;AAED,oEAAoE;AACpE,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED,eAAO,MAAM,KAAK;IAChB,kBAAkB,WAAW,OAAO;CACrC,CAAA"}
|
|
@@ -11,9 +11,11 @@ type Callback<T> = (arg: T) => void;
|
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```typescript
|
|
14
|
-
* export const onRemotePlay =
|
|
14
|
+
* export const onRemotePlay = LazyNativeEmitter.emitterize<void>(
|
|
15
15
|
* (cb) => (nativeBrowser.onRemotePlay = cb)
|
|
16
16
|
* )
|
|
17
|
+
*
|
|
18
|
+
* const unsubscribe = onRemotePlay.addListener(() => console.log('play'))
|
|
17
19
|
* ```
|
|
18
20
|
*/
|
|
19
21
|
export declare class LazyNativeEmitter<T> {
|
|
@@ -23,11 +25,13 @@ export declare class LazyNativeEmitter<T> {
|
|
|
23
25
|
private getListeners;
|
|
24
26
|
addListener(callback: Callback<T>): () => void;
|
|
25
27
|
/**
|
|
26
|
-
* Creates a lazy emitter
|
|
28
|
+
* Creates a lazy emitter for a native callback.
|
|
29
|
+
*
|
|
27
30
|
* @param setter - Function that sets the native callback property
|
|
28
|
-
* @returns
|
|
31
|
+
* @returns The emitter instance — subscribe with `addListener`, which returns
|
|
32
|
+
* an unsubscribe function
|
|
29
33
|
*/
|
|
30
|
-
static emitterize<T>(setter: (callback: (data: T) => void) => void):
|
|
34
|
+
static emitterize<T>(setter: (callback: (data: T) => void) => void): LazyNativeEmitter<T>;
|
|
31
35
|
}
|
|
32
36
|
export {};
|
|
33
37
|
//# sourceMappingURL=LazyNativeEmitter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LazyNativeEmitter.d.ts","sourceRoot":"","sources":["../../../../src/utils/LazyNativeEmitter.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAA;AAEnC
|
|
1
|
+
{"version":3,"file":"LazyNativeEmitter.d.ts","sourceRoot":"","sources":["../../../../src/utils/LazyNativeEmitter.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAA;AAEnC;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,iBAAiB,CAAC,CAAC;IAC9B,OAAO,CAAC,MAAM,CAAuC;IACrD,OAAO,CAAC,SAAS,CAAmC;IAEpD,YAAY,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,KAAK,IAAI,EAExD;IAED,OAAO,CAAC,YAAY;IAWpB,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,CAI7C;IAED;;;;;;OAMG;IACH,MAAM,CAAC,UAAU,CAAC,CAAC,EACjB,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,KAAK,IAAI,GAC5C,iBAAiB,CAAC,CAAC,CAAC,CAEtB;CACF"}
|
|
@@ -40,7 +40,7 @@ target_sources(
|
|
|
40
40
|
../nitrogen/generated/android/c++/JVariant_ResolvedTrack_BrowseError_Promise_BrowseResult_.cpp
|
|
41
41
|
../nitrogen/generated/android/c++/JBrowseResult.cpp
|
|
42
42
|
../nitrogen/generated/android/c++/JSleepTimer.cpp
|
|
43
|
-
../nitrogen/generated/android/c++/
|
|
43
|
+
../nitrogen/generated/android/c++/JVariant_NullType_RemoteButtonLayout.cpp
|
|
44
44
|
../nitrogen/generated/android/c++/JVariant_NullType_Double.cpp
|
|
45
45
|
../nitrogen/generated/android/c++/JVariant_Boolean_FavoriteConfig.cpp
|
|
46
46
|
../nitrogen/generated/android/c++/JVariant_Boolean_AndroidAudioOffloadSettings.cpp
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
|
|
13
13
|
#include "AppKilledPlaybackBehavior.hpp"
|
|
14
14
|
#include "JAppKilledPlaybackBehavior.hpp"
|
|
15
|
-
#include "
|
|
16
|
-
#include "
|
|
17
|
-
#include "
|
|
18
|
-
#include "
|
|
19
|
-
#include "
|
|
15
|
+
#include "JRemoteButton.hpp"
|
|
16
|
+
#include "JRemoteButtonLayout.hpp"
|
|
17
|
+
#include "JVariant_NullType_RemoteButtonLayout.hpp"
|
|
18
|
+
#include "RemoteButton.hpp"
|
|
19
|
+
#include "RemoteButtonLayout.hpp"
|
|
20
20
|
#include <NitroModules/JNull.hpp>
|
|
21
21
|
#include <NitroModules/Null.hpp>
|
|
22
22
|
#include <optional>
|
|
@@ -46,12 +46,12 @@ namespace margelo::nitro::audiobrowser {
|
|
|
46
46
|
jni::local_ref<JAppKilledPlaybackBehavior> appKilledPlaybackBehavior = this->getFieldValue(fieldAppKilledPlaybackBehavior);
|
|
47
47
|
static const auto fieldSkipSilence = clazz->getField<jboolean>("skipSilence");
|
|
48
48
|
jboolean skipSilence = this->getFieldValue(fieldSkipSilence);
|
|
49
|
-
static const auto
|
|
50
|
-
jni::local_ref<
|
|
49
|
+
static const auto fieldRemoteButtonLayout = clazz->getField<JVariant_NullType_RemoteButtonLayout>("remoteButtonLayout");
|
|
50
|
+
jni::local_ref<JVariant_NullType_RemoteButtonLayout> remoteButtonLayout = this->getFieldValue(fieldRemoteButtonLayout);
|
|
51
51
|
return AndroidOptions(
|
|
52
52
|
appKilledPlaybackBehavior->toCpp(),
|
|
53
53
|
static_cast<bool>(skipSilence),
|
|
54
|
-
|
|
54
|
+
remoteButtonLayout != nullptr ? std::make_optional(remoteButtonLayout->toCpp()) : std::nullopt
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -61,14 +61,14 @@ namespace margelo::nitro::audiobrowser {
|
|
|
61
61
|
*/
|
|
62
62
|
[[maybe_unused]]
|
|
63
63
|
static jni::local_ref<JAndroidOptions::javaobject> fromCpp(const AndroidOptions& value) {
|
|
64
|
-
using JSignature = JAndroidOptions(jni::alias_ref<JAppKilledPlaybackBehavior>, jboolean, jni::alias_ref<
|
|
64
|
+
using JSignature = JAndroidOptions(jni::alias_ref<JAppKilledPlaybackBehavior>, jboolean, jni::alias_ref<JVariant_NullType_RemoteButtonLayout>);
|
|
65
65
|
static const auto clazz = javaClassStatic();
|
|
66
66
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
67
67
|
return create(
|
|
68
68
|
clazz,
|
|
69
69
|
JAppKilledPlaybackBehavior::fromCpp(value.appKilledPlaybackBehavior),
|
|
70
70
|
value.skipSilence,
|
|
71
|
-
value.
|
|
71
|
+
value.remoteButtonLayout.has_value() ? JVariant_NullType_RemoteButtonLayout::fromCpp(value.remoteButtonLayout.value()) : nullptr
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
74
|
};
|