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
|
@@ -9,10 +9,11 @@ import NitroModules
|
|
|
9
9
|
/// Note: Method names are prefixed to avoid conflicts with JS callback property names.
|
|
10
10
|
/// All callbacks are called from the main actor since TrackPlayer is @MainActor.
|
|
11
11
|
///
|
|
12
|
-
/// Extends PlaybackCoordinatorCallbacks for the state machine / coordinator callbacks
|
|
13
|
-
///
|
|
12
|
+
/// Extends PlaybackCoordinatorCallbacks for the state machine / coordinator callbacks
|
|
13
|
+
/// and RemoteCommandCallbacks for the remote-command events, then adds metadata,
|
|
14
|
+
/// seek, and configuration callbacks that are TrackPlayer-specific.
|
|
14
15
|
@MainActor
|
|
15
|
-
protocol TrackPlayerCallbacks: PlaybackCoordinatorCallbacks {
|
|
16
|
+
protocol TrackPlayerCallbacks: PlaybackCoordinatorCallbacks, RemoteCommandCallbacks {
|
|
16
17
|
// MARK: - Metadata Events
|
|
17
18
|
|
|
18
19
|
/// Called when common metadata is received.
|
|
@@ -34,32 +35,7 @@ protocol TrackPlayerCallbacks: PlaybackCoordinatorCallbacks {
|
|
|
34
35
|
|
|
35
36
|
// MARK: - Remote Control Events
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
func remotePlay()
|
|
39
|
-
|
|
40
|
-
/// Called when pause is triggered remotely.
|
|
41
|
-
func remotePause()
|
|
42
|
-
|
|
43
|
-
/// Called when stop is triggered remotely.
|
|
44
|
-
func remoteStop()
|
|
45
|
-
|
|
46
|
-
/// Called when toggle play/pause is triggered remotely.
|
|
47
|
-
func remotePlayPause()
|
|
48
|
-
|
|
49
|
-
/// Called when next is triggered remotely.
|
|
50
|
-
func remoteNext()
|
|
51
|
-
|
|
52
|
-
/// Called when previous is triggered remotely.
|
|
53
|
-
func remotePrevious()
|
|
54
|
-
|
|
55
|
-
/// Called when jump forward is triggered remotely.
|
|
56
|
-
func remoteJumpForward(interval: Double)
|
|
57
|
-
|
|
58
|
-
/// Called when jump backward is triggered remotely.
|
|
59
|
-
func remoteJumpBackward(interval: Double)
|
|
60
|
-
|
|
61
|
-
/// Called when seek is triggered remotely.
|
|
62
|
-
func remoteSeek(position: Double)
|
|
38
|
+
// The command-center events live in RemoteCommandCallbacks, inherited above.
|
|
63
39
|
|
|
64
40
|
/// Called when change playback position is triggered remotely.
|
|
65
41
|
func remoteChangePlaybackPosition(position: Double)
|
|
@@ -70,15 +46,6 @@ protocol TrackPlayerCallbacks: PlaybackCoordinatorCallbacks {
|
|
|
70
46
|
/// Called when play from search is triggered remotely.
|
|
71
47
|
func remotePlaySearch(query: String)
|
|
72
48
|
|
|
73
|
-
/// Called when repeat mode change is triggered remotely (CarPlay/lock screen).
|
|
74
|
-
func remoteChangeRepeatMode(mode: RepeatMode)
|
|
75
|
-
|
|
76
|
-
/// Called when shuffle mode change is triggered remotely (CarPlay/lock screen).
|
|
77
|
-
func remoteChangeShuffleMode(enabled: Bool)
|
|
78
|
-
|
|
79
|
-
/// Called when playback rate change is triggered remotely (CarPlay/lock screen).
|
|
80
|
-
func remoteChangePlaybackRate(rate: Float)
|
|
81
|
-
|
|
82
49
|
// MARK: - Configuration Events
|
|
83
50
|
|
|
84
51
|
/// Called when options are changed.
|
package/ios/Util/LRUCache.swift
CHANGED
|
@@ -11,7 +11,10 @@ final class LRUCache<Key: Hashable, Value> {
|
|
|
11
11
|
private final class Node {
|
|
12
12
|
let key: Key
|
|
13
13
|
var value: Value
|
|
14
|
-
|
|
14
|
+
/// Weak: with both directions strong, any two adjacent nodes form a reference cycle, so the
|
|
15
|
+
/// whole chain outlives `clear()` and the cache's own deinit. The list is kept alive from
|
|
16
|
+
/// `head` forwards.
|
|
17
|
+
weak var prev: Node?
|
|
15
18
|
var next: Node?
|
|
16
19
|
|
|
17
20
|
init(key: Key, value: Value) {
|
|
@@ -14,17 +14,6 @@ Object.keys(_features).forEach(function (key) {
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
|
-
var _native = require("./native");
|
|
18
|
-
Object.keys(_native).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _native[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _native[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
17
|
var _types = require("./types");
|
|
29
18
|
Object.keys(_types).forEach(function (key) {
|
|
30
19
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_features","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","
|
|
1
|
+
{"version":3,"names":["_features","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_types","_useDebug"],"sourceRoot":"../../src","sources":["AudioBrowser.ts"],"mappings":";;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,SAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,SAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,SAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,MAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,MAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,MAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,MAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,SAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,SAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,SAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,SAAA,CAAAN,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# TypeScript API
|
|
2
|
+
|
|
3
|
+
The rules here are about the shape of the package's public surface. Both are
|
|
4
|
+
enforced by tests, but the tests only tell you _after_ you've written it.
|
|
5
|
+
|
|
6
|
+
## Everything you export is public
|
|
7
|
+
|
|
8
|
+
`index.ts` → `AudioBrowser.ts` → `features/index.ts` is a chain of unfiltered
|
|
9
|
+
`export *`. There is no allowlist to add a symbol to: a new `export` in any
|
|
10
|
+
feature module joins the package's public surface the moment you write it.
|
|
11
|
+
|
|
12
|
+
`@internal` does **not** make a value private. `stripInternal` honours it when
|
|
13
|
+
building `lib/typescript` — what a consumer's TypeScript sees — but React Native
|
|
14
|
+
resolves `"react-native": "src/index"`, so Metro bundles the _source_, where
|
|
15
|
+
nothing was stripped. An `@internal` value is invisible to the type checker and
|
|
16
|
+
fully reachable at runtime via `require()`.
|
|
17
|
+
|
|
18
|
+
So an internal value needs a module the barrels don't re-export, imported
|
|
19
|
+
directly by its callers — `features/player/validateOptions.ts` is the pattern.
|
|
20
|
+
Types are exempt: they have no runtime representation, so `stripInternal` really
|
|
21
|
+
does remove them, and `@internal` is enough.
|
|
22
|
+
|
|
23
|
+
`native.ts` is the sharp case and stays out of the barrel permanently. It holds
|
|
24
|
+
the raw Nitro object, whose `on*` properties are single callback slots that the
|
|
25
|
+
emitters below already occupy — a consumer assigning one unsubscribes every hook
|
|
26
|
+
in the library. Feature modules import it relatively; nothing else touches it.
|
|
27
|
+
|
|
28
|
+
`public-surface.test.ts` walks the `export *` graph and fails on any reachable
|
|
29
|
+
value that is `@internal`, `__`-prefixed, or `nativeBrowser`.
|
|
30
|
+
|
|
31
|
+
## Events are emitters, not functions
|
|
32
|
+
|
|
33
|
+
Every `on*` export is an object you subscribe to with `addListener(cb)`, which
|
|
34
|
+
returns an unsubscribe function. Never export a bare `on*(cb)` subscribe
|
|
35
|
+
function — that split is what made the whole remote-controls guide a compile
|
|
36
|
+
error until it was unified.
|
|
37
|
+
|
|
38
|
+
Two emitter classes, picked by what the event _is_:
|
|
39
|
+
|
|
40
|
+
- `NativeUpdatedValue` — state with a current value (playback, options,
|
|
41
|
+
progress). Subscribes to native at module load so no update is missed, and
|
|
42
|
+
caches `lastValue` so hooks can read synchronously.
|
|
43
|
+
- `LazyNativeEmitter` — discrete events with no current value (remote controls,
|
|
44
|
+
gate hits). Assigns the native callback on the first `addListener`, so an
|
|
45
|
+
event nobody listens to costs nothing.
|
|
46
|
+
|
|
47
|
+
Both are created via `emitterize(cb => (nativeBrowser.onThing = cb))` and both
|
|
48
|
+
return the instance. Neither class is exported from the package.
|
|
49
|
+
|
|
50
|
+
`on*` observes; `handle*` overrides. `handleRemoteNext(cb)` is a plain setter
|
|
51
|
+
that replaces the default behaviour and takes `undefined` to clear it, while
|
|
52
|
+
`onRemoteNext` fires on every press regardless of who handled it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_native","require","_NativeUpdatedValue","_useNativeUpdatedValue","_browserConfig","currentConfiguration","configureBrowser","configuration","__DEV__","validateBrowserConfiguration","nativeBrowser","toNativeConfig","getBrowserConfiguration","navigate","pathOrTrack","navigatePath","navigateTrack","getPath","path","onPathChanged","exports","NativeUpdatedValue","emitterize","cb","usePath","useNativeUpdatedValue","getContent","onContentChanged","useContent","getTabs","tabs","onTabsChanged","useTabs","notifyContentChanged","invalidateAllContent","hasSearch","config","searchRoute","routes","find","r","SEARCH_ROUTE_PATH","searchCallback","searchConfig","search","query"
|
|
1
|
+
{"version":3,"names":["_native","require","_NativeUpdatedValue","_useNativeUpdatedValue","_browserConfig","currentConfiguration","configureBrowser","configuration","__DEV__","validateBrowserConfiguration","nativeBrowser","toNativeConfig","getBrowserConfiguration","navigate","pathOrTrack","navigatePath","navigateTrack","getPath","path","onPathChanged","exports","NativeUpdatedValue","emitterize","cb","usePath","useNativeUpdatedValue","getContent","onContentChanged","useContent","getTabs","tabs","onTabsChanged","useTabs","notifyContentChanged","invalidateAllContent","hasSearch","config","searchRoute","routes","find","r","SEARCH_ROUTE_PATH","searchCallback","searchConfig","search","query"],"sourceRoot":"../../../src","sources":["features/browser.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -26,7 +26,7 @@ function isCarConnected() {
|
|
|
26
26
|
* Subscribes to car connection changes (CarPlay on iOS, Android Auto /
|
|
27
27
|
* Android Automotive on Android). Never fires on web.
|
|
28
28
|
* @param callback - Called with the new connection state
|
|
29
|
-
* @returns
|
|
29
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
30
30
|
*/
|
|
31
31
|
const onCarConnectedChanged = exports.onCarConnectedChanged = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onCarConnectedChanged = cb);
|
|
32
32
|
|
|
@@ -53,7 +53,7 @@ function setEqualizerLevels(levels) {
|
|
|
53
53
|
/**
|
|
54
54
|
* Subscribes to equalizer settings changes (Android only).
|
|
55
55
|
* @param callback - Called when equalizer settings change
|
|
56
|
-
* @returns
|
|
56
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
57
57
|
*/
|
|
58
58
|
const onEqualizerChanged = exports.onEqualizerChanged = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onEqualizerChanged = cb);
|
|
59
59
|
|
|
@@ -83,7 +83,7 @@ function getPlaybackError() {
|
|
|
83
83
|
/**
|
|
84
84
|
* Subscribes to playback error events.
|
|
85
85
|
* @param callback - Called when a playback error occurs
|
|
86
|
-
* @returns
|
|
86
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
87
87
|
*/
|
|
88
88
|
const onPlaybackError = exports.onPlaybackError = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onPlaybackError = cb);
|
|
89
89
|
|
|
@@ -111,7 +111,7 @@ function getNavigationError() {
|
|
|
111
111
|
/**
|
|
112
112
|
* Subscribes to navigation error events.
|
|
113
113
|
* @param callback - Called when a navigation error occurs
|
|
114
|
-
* @returns
|
|
114
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
115
115
|
*/
|
|
116
116
|
const onNavigationError = exports.onNavigationError = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onNavigationError = cb);
|
|
117
117
|
|
|
@@ -139,7 +139,7 @@ function getFormattedNavigationError() {
|
|
|
139
139
|
/**
|
|
140
140
|
* Subscribes to formatted navigation error changes.
|
|
141
141
|
* @param callback - Called when the formatted navigation error changes
|
|
142
|
-
* @returns
|
|
142
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
143
143
|
*/
|
|
144
144
|
const onFormattedNavigationError = exports.onFormattedNavigationError = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onFormattedNavigationError = cb);
|
|
145
145
|
|
|
@@ -83,7 +83,7 @@ function setFavorites(favorites) {
|
|
|
83
83
|
* The native side has already updated the track's favorite state and UI.
|
|
84
84
|
*
|
|
85
85
|
* @param callback - Called with the track and its new favorite state
|
|
86
|
-
* @returns
|
|
86
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
87
87
|
*
|
|
88
88
|
* @example
|
|
89
89
|
* ```ts
|
|
@@ -115,12 +115,20 @@ _native.nativeBrowser.resolveGate = async req => {
|
|
|
115
115
|
* some surfaces (CarPlay) any gate change pops pushed navigation back to root,
|
|
116
116
|
* so a page the user had drilled into is reset to the tab root. Set the gate
|
|
117
117
|
* before the car connects and it'll be there the moment it does.
|
|
118
|
+
*
|
|
119
|
+
* @platform ios android
|
|
120
|
+
* A no-op on web, which has no CarPlay or Android Auto surfaces for the gate to
|
|
121
|
+
* cover. Nothing is lost: the gate never covered in-app browse UI on any
|
|
122
|
+
* platform — that stays yours to gate.
|
|
118
123
|
*/
|
|
119
124
|
|
|
120
125
|
/**
|
|
121
126
|
* Raises the gate with a resolver only (no default chrome).
|
|
122
127
|
* The resolver must return a {@link Gate} or `true` for gated requests;
|
|
123
128
|
* native uses the built-in fallback chrome when `true` and no default is set.
|
|
129
|
+
*
|
|
130
|
+
* @platform ios android
|
|
131
|
+
* A no-op on web — the resolver is never consulted there.
|
|
124
132
|
*/
|
|
125
133
|
|
|
126
134
|
function setGate(a, b) {
|
|
@@ -135,6 +143,9 @@ function setGate(a, b) {
|
|
|
135
143
|
|
|
136
144
|
/**
|
|
137
145
|
* Drops the gate — the real content comes back, and the current tab is kept.
|
|
146
|
+
*
|
|
147
|
+
* @platform ios android
|
|
148
|
+
* A no-op on web, where no gate was ever raised.
|
|
138
149
|
*/
|
|
139
150
|
function clearGate() {
|
|
140
151
|
resolver = undefined;
|
|
@@ -143,7 +154,11 @@ function clearGate() {
|
|
|
143
154
|
|
|
144
155
|
/**
|
|
145
156
|
* Subscribes to gate events (fired when a request is gated).
|
|
146
|
-
*
|
|
157
|
+
*
|
|
158
|
+
* @platform ios android
|
|
159
|
+
* Never fires on web — there are no gated serves to report.
|
|
160
|
+
*
|
|
161
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
147
162
|
*/
|
|
148
163
|
const onGate = exports.onGate = _LazyNativeEmitter.LazyNativeEmitter.emitterize(cb => _native.nativeBrowser.onGate = cb);
|
|
149
164
|
//# sourceMappingURL=gate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_native","require","_LazyNativeEmitter","resolver","toPublicRequest","req","reason","kind","path","params","search","_exhaustive","Error","String","nativeBrowser","resolveGate","result","gated","gate","setGate","a","b","undefined","clearGate","onGate","exports","LazyNativeEmitter","emitterize","cb"],"sourceRoot":"../../../src","sources":["features/gate.ts"],"mappings":";;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAEA;;AAEA;;AAGA;AACA;AACA;AACA;AACA;;AAOA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;;AAGA;;AAEA,IAAIE,QAAkC;AAEtC,SAASC,eAAeA,CAACC,GAAsB,EAAe;EAC5D,QAAQA,GAAG,CAACC,MAAM;IAChB,KAAK,QAAQ;MACX,OAAO;QAAEC,IAAI,EAAE,QAAQ;QAAEC,IAAI,EAAEH,GAAG,CAACG,IAAI,IAAI;MAAG,CAAC;IACjD,KAAK,QAAQ;MACX;MACA;MACA;MACA;MACA,OAAO;QAAED,IAAI,EAAE,QAAQ;QAAEE,MAAM,EAAEJ,GAAG,CAACK;MAAQ,CAAC;IAChD;MAAS;QACP,MAAMC,WAAkB,GAAGN,GAAG,CAACC,MAAM;QACrC,MAAM,IAAIM,KAAK,CAAC,yBAAyBC,MAAM,CAACF,WAAW,CAAC,EAAE,CAAC;MACjE;EACF;AACF;;AAEA;AACA;AACAG,qBAAa,CAACC,WAAW,GAAG,MAC1BV,GAAsB,IACI;EAC1B,MAAMW,MAAM,GAAGb,QAAQ,GAAGA,QAAQ,CAACC,eAAe,CAACC,GAAG,CAAC,CAAC,GAAG,IAAI;EAC/D,IAAIW,MAAM,KAAK,KAAK,EAAE,OAAO;IAAEC,KAAK,EAAE;EAAM,CAAC;EAC7C,IAAID,MAAM,KAAK,IAAI,EAAE,OAAO;IAAEC,KAAK,EAAE;EAAK,CAAC;EAC3C,OAAO;IAAEA,KAAK,EAAE,IAAI;IAAEC,IAAI,EAAEF;EAAO,CAAC;AACtC,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEO,SAASG,OAAOA,CAACC,CAAsB,EAAEC,CAAgB,EAAQ;EACtE,IAAI,OAAOD,CAAC,KAAK,UAAU,EAAE;IAC3BjB,QAAQ,GAAGiB,CAAC;IACZN,qBAAa,CAACK,OAAO,CAACG,SAAS,EAAE,IAAI,CAAC;EACxC,CAAC,MAAM;IACLnB,QAAQ,GAAGkB,CAAC;IACZP,qBAAa,CAACK,OAAO,CAACC,CAAC,EAAEC,CAAC,IAAI,IAAI,CAAC;EACrC;AACF;;AAEA;AACA;AACA;AACO,SAASE,SAASA,CAAA,EAAS;EAChCpB,QAAQ,GAAGmB,SAAS;EACpBR,qBAAa,CAACS,SAAS,CAAC,CAAC;AAC3B;;AAEA;AACA;AACA;AACA;AACO,MAAMC,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAGE,oCAAiB,CAACC,UAAU,CAC/CC,EAAE,IAAMd,qBAAa,CAACU,MAAM,GAAGI,EAClC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_native","require","_LazyNativeEmitter","resolver","toPublicRequest","req","reason","kind","path","params","search","_exhaustive","Error","String","nativeBrowser","resolveGate","result","gated","gate","setGate","a","b","undefined","clearGate","onGate","exports","LazyNativeEmitter","emitterize","cb"],"sourceRoot":"../../../src","sources":["features/gate.ts"],"mappings":";;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAEA;;AAEA;;AAGA;AACA;AACA;AACA;AACA;;AAOA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;;AAGA;;AAEA,IAAIE,QAAkC;AAEtC,SAASC,eAAeA,CAACC,GAAsB,EAAe;EAC5D,QAAQA,GAAG,CAACC,MAAM;IAChB,KAAK,QAAQ;MACX,OAAO;QAAEC,IAAI,EAAE,QAAQ;QAAEC,IAAI,EAAEH,GAAG,CAACG,IAAI,IAAI;MAAG,CAAC;IACjD,KAAK,QAAQ;MACX;MACA;MACA;MACA;MACA,OAAO;QAAED,IAAI,EAAE,QAAQ;QAAEE,MAAM,EAAEJ,GAAG,CAACK;MAAQ,CAAC;IAChD;MAAS;QACP,MAAMC,WAAkB,GAAGN,GAAG,CAACC,MAAM;QACrC,MAAM,IAAIM,KAAK,CAAC,yBAAyBC,MAAM,CAACF,WAAW,CAAC,EAAE,CAAC;MACjE;EACF;AACF;;AAEA;AACA;AACAG,qBAAa,CAACC,WAAW,GAAG,MAC1BV,GAAsB,IACI;EAC1B,MAAMW,MAAM,GAAGb,QAAQ,GAAGA,QAAQ,CAACC,eAAe,CAACC,GAAG,CAAC,CAAC,GAAG,IAAI;EAC/D,IAAIW,MAAM,KAAK,KAAK,EAAE,OAAO;IAAEC,KAAK,EAAE;EAAM,CAAC;EAC7C,IAAID,MAAM,KAAK,IAAI,EAAE,OAAO;IAAEC,KAAK,EAAE;EAAK,CAAC;EAC3C,OAAO;IAAEA,KAAK,EAAE,IAAI;IAAEC,IAAI,EAAEF;EAAO,CAAC;AACtC,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,SAASG,OAAOA,CAACC,CAAsB,EAAEC,CAAgB,EAAQ;EACtE,IAAI,OAAOD,CAAC,KAAK,UAAU,EAAE;IAC3BjB,QAAQ,GAAGiB,CAAC;IACZN,qBAAa,CAACK,OAAO,CAACG,SAAS,EAAE,IAAI,CAAC;EACxC,CAAC,MAAM;IACLnB,QAAQ,GAAGkB,CAAC;IACZP,qBAAa,CAACK,OAAO,CAACC,CAAC,EAAEC,CAAC,IAAI,IAAI,CAAC;EACrC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,SAASA,CAAA,EAAS;EAChCpB,QAAQ,GAAGmB,SAAS;EACpBR,qBAAa,CAACS,SAAS,CAAC,CAAC;AAC3B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAGE,oCAAiB,CAACC,UAAU,CAC/CC,EAAE,IAAMd,qBAAa,CAACU,MAAM,GAAGI,EAClC,CAAC","ignoreList":[]}
|
|
@@ -33,22 +33,39 @@ var _NativeUpdatedValue = require("../utils/NativeUpdatedValue");
|
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* Subscribes to chapter metadata events.
|
|
36
|
+
*
|
|
37
|
+
* @platform ios android
|
|
38
|
+
* Never fires on web — the web player does not read chapter markers. See
|
|
39
|
+
* {@link https://github.com/radio-garden/react-native-audio-browser/issues/118 | #118}.
|
|
40
|
+
*
|
|
36
41
|
* @param callback - Called when chapter metadata is received
|
|
37
|
-
* @returns
|
|
42
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
38
43
|
*/
|
|
39
44
|
const onChapterMetadata = exports.onChapterMetadata = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onChapterMetadata = cb);
|
|
40
45
|
|
|
41
46
|
/**
|
|
42
47
|
* Subscribes to track metadata events.
|
|
48
|
+
*
|
|
49
|
+
* @platform ios android
|
|
50
|
+
* Never fires on web — the web player does not read embedded file tags. See
|
|
51
|
+
* {@link https://github.com/radio-garden/react-native-audio-browser/issues/118 | #118}.
|
|
52
|
+
*
|
|
43
53
|
* @param callback - Called when static track metadata is received
|
|
44
|
-
* @returns
|
|
54
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
45
55
|
*/
|
|
46
56
|
const onTrackMetadata = exports.onTrackMetadata = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onTrackMetadata = cb);
|
|
47
57
|
|
|
48
58
|
/**
|
|
49
59
|
* Subscribes to timed metadata events (ICY/ID3 from live streams).
|
|
60
|
+
*
|
|
61
|
+
* @platform ios android
|
|
62
|
+
* Never fires on web. ICY metadata is stripped by the browser before the player
|
|
63
|
+
* can see it, and no browser API exposes it; in-band ID3 from HLS is reachable
|
|
64
|
+
* but not yet wired. See
|
|
65
|
+
* {@link https://github.com/radio-garden/react-native-audio-browser/issues/118 | #118}.
|
|
66
|
+
*
|
|
50
67
|
* @param callback - Called when stream metadata is received (title, artist from ICY/ID3 tags)
|
|
51
|
-
* @returns
|
|
68
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
52
69
|
*/
|
|
53
70
|
const onTimedMetadata = exports.onTimedMetadata = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onTimedMetadata = cb);
|
|
54
71
|
//# sourceMappingURL=metadata.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_native","require","_NativeUpdatedValue","onChapterMetadata","exports","NativeUpdatedValue","emitterize","cb","nativeBrowser","onTrackMetadata","onTimedMetadata"],"sourceRoot":"../../../src","sources":["features/metadata.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAEA;;AAyBA;AACA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;;AAYA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAME,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAGE,sCAAkB,CAACC,UAAU,CAE3DC,EAAE,IAAMC,qBAAa,CAACL,iBAAiB,GAAGI,EAAG,CAAC;;AAEjD;AACA;AACA;AACA;AACA;AACO,MAAME,eAAe,GAAAL,OAAA,CAAAK,eAAA,GAAGJ,sCAAkB,CAACC,UAAU,CACzDC,EAAE,IAAMC,qBAAa,CAACC,eAAe,GAAGF,EAC3C,CAAC;;AAED;AACA;AACA;AACA;AACA;AACO,MAAMG,eAAe,GAAAN,OAAA,CAAAM,eAAA,GAAGL,sCAAkB,CAACC,UAAU,CACzDC,EAAE,IAAMC,qBAAa,CAACE,eAAe,GAAGH,EAC3C,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_native","require","_NativeUpdatedValue","onChapterMetadata","exports","NativeUpdatedValue","emitterize","cb","nativeBrowser","onTrackMetadata","onTimedMetadata"],"sourceRoot":"../../../src","sources":["features/metadata.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAEA;;AAyBA;AACA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;;AAYA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAGE,sCAAkB,CAACC,UAAU,CAE3DC,EAAE,IAAMC,qBAAa,CAACL,iBAAiB,GAAGI,EAAG,CAAC;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,eAAe,GAAAL,OAAA,CAAAK,eAAA,GAAGJ,sCAAkB,CAACC,UAAU,CACzDC,EAAE,IAAMC,qBAAa,CAACC,eAAe,GAAGF,EAC3C,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,eAAe,GAAAN,OAAA,CAAAM,eAAA,GAAGL,sCAAkB,CAACC,UAAU,CACzDC,EAAE,IAAMC,qBAAa,CAACE,eAAe,GAAGH,EAC3C,CAAC","ignoreList":[]}
|
|
@@ -24,7 +24,7 @@ function getOnline() {
|
|
|
24
24
|
/**
|
|
25
25
|
* Subscribes to network connectivity changes.
|
|
26
26
|
* @param callback - Called when network state changes
|
|
27
|
-
* @returns
|
|
27
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
28
28
|
*/
|
|
29
29
|
const onOnlineChanged = exports.onOnlineChanged = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onOnlineChanged = cb);
|
|
30
30
|
|
|
@@ -80,7 +80,7 @@ function clearNowPlayingFlash() {
|
|
|
80
80
|
* Subscribes to now playing metadata change events.
|
|
81
81
|
* Fires when updateNowPlaying is called or when the track changes.
|
|
82
82
|
* @param callback - Called when now playing metadata changes
|
|
83
|
-
* @returns
|
|
83
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
84
84
|
*/
|
|
85
85
|
const onNowPlayingChanged = exports.onNowPlayingChanged = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onNowPlayingChanged = cb);
|
|
86
86
|
|
|
@@ -52,7 +52,7 @@ function getOutput() {
|
|
|
52
52
|
/**
|
|
53
53
|
* Subscribes to current-output changes (headphones unplugged, Bluetooth speaker
|
|
54
54
|
* connected, AirPlay/route selected). Fires on iOS and Android 11+; never below.
|
|
55
|
-
* @returns
|
|
55
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
56
56
|
*/
|
|
57
57
|
const onOutputChanged = exports.onOutputChanged = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onOutputChanged = cb);
|
|
58
58
|
|
|
@@ -39,7 +39,7 @@ function setPlayWhenReady(playWhenReady) {
|
|
|
39
39
|
/**
|
|
40
40
|
* Subscribes to play when ready changes.
|
|
41
41
|
* @param callback - Called when playWhenReady changes
|
|
42
|
-
* @returns
|
|
42
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
43
43
|
*/
|
|
44
44
|
const onPlayWhenReadyChanged = exports.onPlayWhenReadyChanged = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onPlaybackPlayWhenReadyChanged = cb);
|
|
45
45
|
|
|
@@ -25,7 +25,7 @@ function getPlayingState() {
|
|
|
25
25
|
/**
|
|
26
26
|
* Subscribes to playing state changes.
|
|
27
27
|
* @param callback - Called when playing or buffering state changes
|
|
28
|
-
* @returns
|
|
28
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
29
29
|
*/
|
|
30
30
|
const onPlayingState = exports.onPlayingState = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onPlaybackPlayingState = cb);
|
|
31
31
|
|
|
@@ -35,7 +35,7 @@ function getProgress() {
|
|
|
35
35
|
/**
|
|
36
36
|
* Subscribes to playback progress updates.
|
|
37
37
|
* @param callback - Called periodically with playback progress updates
|
|
38
|
-
* @returns
|
|
38
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
39
39
|
*/
|
|
40
40
|
const onProgressUpdated = exports.onProgressUpdated = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onPlaybackProgressUpdated = cb);
|
|
41
41
|
|
|
@@ -46,7 +46,7 @@ function getPlayback() {
|
|
|
46
46
|
/**
|
|
47
47
|
* Subscribes to playback state changes.
|
|
48
48
|
* @param callback - Called when the playback state changes
|
|
49
|
-
* @returns
|
|
49
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
50
50
|
*/
|
|
51
51
|
const onPlaybackChanged = exports.onPlaybackChanged = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onPlaybackChanged = cb);
|
|
52
52
|
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.__emitTickForTests = __emitTickForTests;
|
|
7
6
|
exports.trackPlaybackTime = trackPlaybackTime;
|
|
8
7
|
var _native = require("../../native");
|
|
9
8
|
var _activeTrack = require("../queue/activeTrack");
|
|
@@ -84,9 +83,4 @@ function trackPlaybackTime(callback, period) {
|
|
|
84
83
|
if (handles.size === 0) _native.nativeBrowser.setPlaybackIntervalEnabled(false);
|
|
85
84
|
};
|
|
86
85
|
}
|
|
87
|
-
|
|
88
|
-
/** @internal test hook — drives the fan-out without a native tick. */
|
|
89
|
-
function __emitTickForTests(ticks = 1) {
|
|
90
|
-
for (let i = 0; i < ticks; i++) onTick();
|
|
91
|
-
}
|
|
92
86
|
//# sourceMappingURL=trackPlaybackTime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_native","require","_activeTrack","handles","Set","installed","currentTrack","onTick","handle","totalSeconds","sinceLast","lastFireSeconds","period","callback","total","track","install","nativeBrowser","onPlaybackInterval","onActiveTrackChanged","addListener","event","trackPlaybackTime","Error","add","size","setPlaybackIntervalEnabled","delete"
|
|
1
|
+
{"version":3,"names":["_native","require","_activeTrack","handles","Set","installed","currentTrack","onTick","handle","totalSeconds","sinceLast","lastFireSeconds","period","callback","total","track","install","nativeBrowser","onPlaybackInterval","onActiveTrackChanged","addListener","event","trackPlaybackTime","Error","add","size","setPlaybackIntervalEnabled","delete"],"sourceRoot":"../../../../src","sources":["features/playback/trackPlaybackTime.ts"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA;;AAkBA;;AAEA,MAAME,OAAO,GAAG,IAAIC,GAAG,CAAS,CAAC;AACjC,IAAIC,SAAS,GAAG,KAAK;AACrB,IAAIC,YAA+B;;AAEnC;AACA;AACA;AACA,SAASC,MAAMA,CAAA,EAAG;EAChB,KAAK,MAAMC,MAAM,IAAIL,OAAO,EAAE;IAC5BK,MAAM,CAACC,YAAY,IAAI,CAAC;IACxB,MAAMC,SAAS,GAAGF,MAAM,CAACC,YAAY,GAAGD,MAAM,CAACG,eAAe;IAC9D,IAAID,SAAS,IAAIF,MAAM,CAACI,MAAM,EAAE;MAC9BJ,MAAM,CAACG,eAAe,GAAGH,MAAM,CAACC,YAAY;MAC5CD,MAAM,CAACK,QAAQ,CAAC;QACdC,KAAK,EAAEN,MAAM,CAACC,YAAY;QAC1BC,SAAS;QACTK,KAAK,EAAET;MACT,CAAC,CAAC;IACJ;EACF;AACF;AAEA,SAASU,OAAOA,CAAA,EAAG;EACjB,IAAIX,SAAS,EAAE;EACfA,SAAS,GAAG,IAAI;EAChBY,qBAAa,CAACC,kBAAkB,GAAGX,MAAM;EACzCY,iCAAoB,CAACC,WAAW,CAAEC,KAAK,IAAK;IAC1Cf,YAAY,GAAGe,KAAK,CAACN,KAAK;EAC5B,CAAC,CAAC;AACJ;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASO,iBAAiBA,CAC/BT,QAA4C,EAC5CD,MAAc,EACF;EACZ,IAAI,EAAEA,MAAM,IAAI,CAAC,CAAC,EAAE;IAClB,MAAM,IAAIW,KAAK,CAAC,wCAAwC,CAAC;EAC3D;EACAP,OAAO,CAAC,CAAC;EACT,MAAMR,MAAc,GAAG;IACrBI,MAAM;IACNH,YAAY,EAAE,CAAC;IACfE,eAAe,EAAE,CAAC;IAClBE;EACF,CAAC;EACDV,OAAO,CAACqB,GAAG,CAAChB,MAAM,CAAC;EACnB,IAAIL,OAAO,CAACsB,IAAI,KAAK,CAAC,EAAER,qBAAa,CAACS,0BAA0B,CAAC,IAAI,CAAC;EACtE,OAAO,MAAM;IACX,IAAI,CAACvB,OAAO,CAACwB,MAAM,CAACnB,MAAM,CAAC,EAAE;IAC7B,IAAIL,OAAO,CAACsB,IAAI,KAAK,CAAC,EAAER,qBAAa,CAACS,0BAA0B,CAAC,KAAK,CAAC;EACzE,CAAC;AACH","ignoreList":[]}
|
|
@@ -52,7 +52,7 @@ function setSystemVolume(level) {
|
|
|
52
52
|
/**
|
|
53
53
|
* Subscribes to system volume changes.
|
|
54
54
|
* @param callback - Called when the system volume changes
|
|
55
|
-
* @returns
|
|
55
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
56
56
|
*/
|
|
57
57
|
const onSystemVolumeChanged = exports.onSystemVolumeChanged = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onSystemVolumeChanged = cb);
|
|
58
58
|
|
|
@@ -7,10 +7,10 @@ exports.getOptions = getOptions;
|
|
|
7
7
|
exports.onOptionsChanged = void 0;
|
|
8
8
|
exports.updateOptions = updateOptions;
|
|
9
9
|
exports.useOptions = useOptions;
|
|
10
|
-
exports.validateIOSUpdateOptions = validateIOSUpdateOptions;
|
|
11
10
|
var _native = require("../../native");
|
|
12
11
|
var _NativeUpdatedValue = require("../../utils/NativeUpdatedValue");
|
|
13
12
|
var _useNativeUpdatedValue = require("../../utils/useNativeUpdatedValue");
|
|
13
|
+
var _validateOptions = require("./validateOptions");
|
|
14
14
|
// MARK: - Types
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -31,34 +31,64 @@ var _useNativeUpdatedValue = require("../../utils/useNativeUpdatedValue");
|
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
* Buttons that can be
|
|
35
|
-
*
|
|
34
|
+
* Buttons that can be placed in the Android button layout — the interactive
|
|
35
|
+
* controls a listener taps in the notification, on the Android Auto Now Playing
|
|
36
|
+
* screen, and in the Android 13+ system media controls.
|
|
36
37
|
*/
|
|
37
38
|
|
|
38
39
|
/**
|
|
39
|
-
*
|
|
40
|
-
* Allows explicit control over which buttons appear in which slots.
|
|
40
|
+
* Where each button sits on Android.
|
|
41
41
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
42
|
+
* Android offers exactly three positions, and play/pause always occupies the
|
|
43
|
+
* centre — you cannot move it, and you cannot put two buttons on the same side
|
|
44
|
+
* of it:
|
|
45
|
+
*
|
|
46
|
+
* ```
|
|
47
|
+
* back │ ▶ play/pause │ forward overflow ⋯
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* - **`back`** — the single position left of play/pause
|
|
51
|
+
* - **`forward`** — the single position right of play/pause
|
|
52
|
+
* - **`overflow`** — everything else, in priority order
|
|
53
|
+
*
|
|
54
|
+
* **A layout describes the whole arrangement.** All three fields are required —
|
|
55
|
+
* there is no per-field merge with the capability defaults, so what you write is
|
|
56
|
+
* exactly what renders. Use `undefined` for an empty position and `[]` for no
|
|
57
|
+
* overflow. To go back to the derived defaults, omit `remoteButtonLayout`
|
|
58
|
+
* entirely (or set it to `null`); that is the only switch.
|
|
59
|
+
*
|
|
60
|
+
* **Overflow order is priority, not coordinates.** Each surface renders as many
|
|
61
|
+
* buttons as it has room for, taking them from the front — a phone
|
|
62
|
+
* notification, the Android 13+ system media controls, and a car head unit all
|
|
63
|
+
* have different budgets. A head unit with a spare slot may promote the first
|
|
64
|
+
* overflow entry onto the main row, and a long list gets truncated by whichever
|
|
65
|
+
* surface is showing it. Put what matters most first.
|
|
66
|
+
*
|
|
67
|
+
* Placement never changes what a control *can* do: a button left out entirely
|
|
68
|
+
* still responds to a Bluetooth remote or headset, as long as its
|
|
69
|
+
* {@link PlayerCapabilities} entry is enabled.
|
|
46
70
|
*
|
|
47
71
|
* @example
|
|
48
72
|
* ```typescript
|
|
49
|
-
* // Podcast-style: jump
|
|
50
|
-
*
|
|
73
|
+
* // Podcast-style: jump either side of play/pause
|
|
74
|
+
* remoteButtonLayout: {
|
|
51
75
|
* back: 'jump-backward',
|
|
52
76
|
* forward: 'jump-forward',
|
|
53
|
-
* overflow: ['favorite']
|
|
77
|
+
* overflow: ['skip-to-previous', 'skip-to-next', 'favorite']
|
|
54
78
|
* }
|
|
55
79
|
*
|
|
56
|
-
* // Music-style: skip
|
|
57
|
-
*
|
|
80
|
+
* // Music-style: skip either side of play/pause
|
|
81
|
+
* remoteButtonLayout: {
|
|
58
82
|
* back: 'skip-to-previous',
|
|
59
83
|
* forward: 'skip-to-next',
|
|
60
|
-
*
|
|
61
|
-
*
|
|
84
|
+
* overflow: ['favorite']
|
|
85
|
+
* }
|
|
86
|
+
*
|
|
87
|
+
* // Live radio: forward only, nothing to the left
|
|
88
|
+
* remoteButtonLayout: {
|
|
89
|
+
* back: undefined,
|
|
90
|
+
* forward: 'skip-to-next',
|
|
91
|
+
* overflow: []
|
|
62
92
|
* }
|
|
63
93
|
* ```
|
|
64
94
|
*/
|
|
@@ -142,22 +172,6 @@ var _useNativeUpdatedValue = require("../../utils/useNativeUpdatedValue");
|
|
|
142
172
|
|
|
143
173
|
// MARK: - Functions
|
|
144
174
|
|
|
145
|
-
const MAX_CARPLAY_NOW_PLAYING_BUTTONS = 5;
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Warns when more CarPlay now-playing buttons are configured than CarPlay renders.
|
|
149
|
-
* Shared by {@link updateOptions} and `setupPlayer` (both can carry `ios` options).
|
|
150
|
-
*
|
|
151
|
-
* @internal Validation helper, not public API — `stripInternal` removes it from
|
|
152
|
-
* the published types and typedoc hides it from the docs.
|
|
153
|
-
*/
|
|
154
|
-
function validateIOSUpdateOptions(ios) {
|
|
155
|
-
const buttons = ios?.carPlayNowPlayingButtons;
|
|
156
|
-
if (buttons && buttons.length > MAX_CARPLAY_NOW_PLAYING_BUTTONS) {
|
|
157
|
-
console.warn(`[react-native-audio-browser] ${buttons.length} CarPlay now-playing ` + `buttons configured; CarPlay shows at most ${MAX_CARPLAY_NOW_PLAYING_BUTTONS}.`);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
175
|
/**
|
|
162
176
|
* Updates the configuration for the components.
|
|
163
177
|
* Pass only the properties you want to change - all properties are optional.
|
|
@@ -174,7 +188,7 @@ function validateIOSUpdateOptions(ios) {
|
|
|
174
188
|
* ```
|
|
175
189
|
*/
|
|
176
190
|
function updateOptions(options) {
|
|
177
|
-
validateIOSUpdateOptions(options.ios);
|
|
191
|
+
(0, _validateOptions.validateIOSUpdateOptions)(options.ios);
|
|
178
192
|
_native.nativeBrowser.updateOptions(options);
|
|
179
193
|
}
|
|
180
194
|
|
|
@@ -202,7 +216,7 @@ function getOptions() {
|
|
|
202
216
|
/**
|
|
203
217
|
* Subscribes to player options changes.
|
|
204
218
|
* @param callback - Called when the player options change
|
|
205
|
-
* @returns
|
|
219
|
+
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
206
220
|
*/
|
|
207
221
|
const onOptionsChanged = exports.onOptionsChanged = _NativeUpdatedValue.NativeUpdatedValue.emitterize(cb => _native.nativeBrowser.onOptionsChanged = cb);
|
|
208
222
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_native","require","_NativeUpdatedValue","_useNativeUpdatedValue","
|
|
1
|
+
{"version":3,"names":["_native","require","_NativeUpdatedValue","_useNativeUpdatedValue","_validateOptions","updateOptions","options","validateIOSUpdateOptions","ios","nativeBrowser","getOptions","onOptionsChanged","exports","NativeUpdatedValue","emitterize","cb","useOptions","useNativeUpdatedValue"],"sourceRoot":"../../../../src","sources":["features/player/options.ts"],"mappings":";;;;;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgGA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA4CA;AACA;AACA;AACA;;AA4EA;AACA;AACA;AACA;;AAOA;AACA;AACA;AACA;;AA6BA;AACA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAuDA;AACA;AACA;AACA;;AAwCA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,aAAaA,CAACC,OAAsB,EAAQ;EAC1D,IAAAC,yCAAwB,EAACD,OAAO,CAACE,GAAG,CAAC;EACrCC,qBAAa,CAACJ,aAAa,CAACC,OAAO,CAAC;AACtC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,UAAUA,CAAA,EAAY;EACpC,OAAOD,qBAAa,CAACC,UAAU,CAAC,CAAC;AACnC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAGE,sCAAkB,CAACC,UAAU,CAC1DC,EAAE,IAAMN,qBAAa,CAACE,gBAAgB,GAAGI,EAC5C,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAAA,EAAY;EACpC,OAAO,IAAAC,4CAAqB,EAACP,UAAU,EAAEC,gBAAgB,CAAC;AAC5D","ignoreList":[]}
|