react-native-audio-browser 0.2.0-next.53 → 0.2.0-next.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -19
- package/android/src/cast/java/com/audiobrowser/cast/CastSupport.kt +8 -10
- package/android/src/main/java/com/audiobrowser/AudioBrowser.kt +96 -243
- package/android/src/main/java/com/audiobrowser/AudioBrowserLifecycleModule.kt +8 -12
- package/android/src/main/java/com/audiobrowser/AudioBrowserPackage.kt +1 -3
- package/android/src/main/java/com/audiobrowser/Callbacks.kt +1 -10
- package/android/src/main/java/com/audiobrowser/ForegroundStart.kt +13 -18
- package/android/src/main/java/com/audiobrowser/HeadlessTaskService.kt +3 -7
- package/android/src/main/java/com/audiobrowser/RemoteOutputs.kt +8 -10
- package/android/src/main/java/com/audiobrowser/Service.kt +20 -61
- package/android/src/main/java/com/audiobrowser/ServiceBinding.kt +9 -17
- package/android/src/main/java/com/audiobrowser/browser/ArtworkResolutionRegistry.kt +10 -9
- package/android/src/main/java/com/audiobrowser/browser/BrowseArtworkRegistry.kt +11 -8
- package/android/src/main/java/com/audiobrowser/browser/BrowserManager.kt +117 -448
- package/android/src/main/java/com/audiobrowser/browser/BrowserUrlResolution.kt +21 -60
- package/android/src/main/java/com/audiobrowser/browser/InertStyleDiagnostic.kt +20 -80
- package/android/src/main/java/com/audiobrowser/browser/JsonArtwork.kt +6 -10
- package/android/src/main/java/com/audiobrowser/browser/JsonModels.kt +7 -24
- package/android/src/main/java/com/audiobrowser/browser/RouteMatch.kt +2 -4
- package/android/src/main/java/com/audiobrowser/browser/SectionScope.kt +13 -31
- package/android/src/main/java/com/audiobrowser/browser/SimpleRouter.kt +12 -40
- package/android/src/main/java/com/audiobrowser/browser/StyleResolver.kt +15 -26
- package/android/src/main/java/com/audiobrowser/browser/TrackLoadHandler.kt +5 -15
- package/android/src/main/java/com/audiobrowser/extension/EnumExtensions.kt +1 -0
- package/android/src/main/java/com/audiobrowser/extension/NumberExt.kt +2 -0
- package/android/src/main/java/com/audiobrowser/extension/ResolvedTrackExt.kt +4 -8
- package/android/src/main/java/com/audiobrowser/extension/TappedTrack.kt +4 -6
- package/android/src/main/java/com/audiobrowser/extension/TrackIdentity.kt +3 -7
- package/android/src/main/java/com/audiobrowser/http/HttpClient.kt +13 -22
- package/android/src/main/java/com/audiobrowser/http/RequestConfigBuilder.kt +17 -38
- package/android/src/main/java/com/audiobrowser/model/IcyTitle.kt +5 -6
- package/android/src/main/java/com/audiobrowser/model/PlaybackMetadata.kt +4 -9
- package/android/src/main/java/com/audiobrowser/model/PlayerSetupOptions.kt +18 -29
- package/android/src/main/java/com/audiobrowser/model/PlayerUpdateOptions.kt +6 -16
- package/android/src/main/java/com/audiobrowser/player/AutomaticBufferManager.kt +15 -45
- package/android/src/main/java/com/audiobrowser/player/CapabilityControls.kt +23 -59
- package/android/src/main/java/com/audiobrowser/player/CrossOriginHeaderStripper.kt +14 -26
- package/android/src/main/java/com/audiobrowser/player/DynamicLoadControl.kt +15 -43
- package/android/src/main/java/com/audiobrowser/player/EnginePlayback.kt +4 -4
- package/android/src/main/java/com/audiobrowser/player/EqualizerController.kt +15 -21
- package/android/src/main/java/com/audiobrowser/player/InterceptingPlayer.kt +14 -31
- package/android/src/main/java/com/audiobrowser/player/LocalEngine.kt +8 -8
- package/android/src/main/java/com/audiobrowser/player/MediaFactory.kt +16 -27
- package/android/src/main/java/com/audiobrowser/player/MediaSessionCallback.kt +119 -237
- package/android/src/main/java/com/audiobrowser/player/MediaSessionCommandManager.kt +48 -145
- package/android/src/main/java/com/audiobrowser/player/NowPlayingUpdater.kt +39 -100
- package/android/src/main/java/com/audiobrowser/player/PlaybackErrorClassifier.kt +16 -26
- package/android/src/main/java/com/audiobrowser/player/PlaybackStateMachine.kt +22 -28
- package/android/src/main/java/com/audiobrowser/player/PlaybackStateStore.kt +28 -64
- package/android/src/main/java/com/audiobrowser/player/PlaybackTimer.kt +8 -4
- package/android/src/main/java/com/audiobrowser/player/Player.kt +117 -405
- package/android/src/main/java/com/audiobrowser/player/PlayerCapabilitiesExt.kt +1 -1
- package/android/src/main/java/com/audiobrowser/player/PlayerEngineFactory.kt +11 -19
- package/android/src/main/java/com/audiobrowser/player/PlayerListener.kt +30 -96
- package/android/src/main/java/com/audiobrowser/player/RetryLoadErrorHandlingPolicy.kt +39 -95
- package/android/src/main/java/com/audiobrowser/player/ShuffleOrderLedBy.kt +7 -13
- package/android/src/main/java/com/audiobrowser/player/SleepTimer.kt +13 -30
- package/android/src/main/java/com/audiobrowser/player/SleepTimerManager.kt +7 -11
- package/android/src/main/java/com/audiobrowser/player/StuckRecoveryPolicy.kt +9 -22
- package/android/src/main/java/com/audiobrowser/player/TransformingDataSource.kt +22 -54
- package/android/src/main/java/com/audiobrowser/player/VolumeFader.kt +8 -15
- package/android/src/main/java/com/audiobrowser/remote/RemoteItem.kt +9 -8
- package/android/src/main/java/com/audiobrowser/remote/RemoteOutputsController.kt +13 -10
- package/android/src/main/java/com/audiobrowser/remote/RemotePlayback.kt +8 -8
- package/android/src/main/java/com/audiobrowser/remote/RemoteQueue.kt +12 -5
- package/android/src/main/java/com/audiobrowser/remote/RemoteSwitchingPlayer.kt +28 -48
- package/android/src/main/java/com/audiobrowser/sonos/DeviceDescriptionParser.kt +11 -19
- package/android/src/main/java/com/audiobrowser/sonos/DidlLite.kt +2 -2
- package/android/src/main/java/com/audiobrowser/sonos/SoapClient.kt +6 -6
- package/android/src/main/java/com/audiobrowser/sonos/SoapEnvelopes.kt +8 -9
- package/android/src/main/java/com/audiobrowser/sonos/SoapResponseParser.kt +11 -18
- package/android/src/main/java/com/audiobrowser/sonos/SonosDiscoverer.kt +10 -10
- package/android/src/main/java/com/audiobrowser/sonos/SonosOutputs.kt +10 -10
- package/android/src/main/java/com/audiobrowser/sonos/SonosPlayer.kt +21 -33
- package/android/src/main/java/com/audiobrowser/sonos/SonosRemote.kt +4 -6
- package/android/src/main/java/com/audiobrowser/sonos/SonosRouteProviderService.kt +9 -10
- package/android/src/main/java/com/audiobrowser/sonos/SonosStreamUri.kt +7 -7
- package/android/src/main/java/com/audiobrowser/sonos/SonosTransport.kt +5 -4
- package/android/src/main/java/com/audiobrowser/sonos/SsdpDiscovery.kt +8 -3
- package/android/src/main/java/com/audiobrowser/sonos/SsdpMessages.kt +4 -6
- package/android/src/main/java/com/audiobrowser/sonos/ZoneGroupState.kt +13 -11
- package/android/src/main/java/com/audiobrowser/tls/AiaCertChaser.kt +34 -71
- package/android/src/main/java/com/audiobrowser/tls/AiaChasingExtendedTrustManager.kt +20 -37
- package/android/src/main/java/com/audiobrowser/tls/AiaChasingTrustManager.kt +18 -27
- package/android/src/main/java/com/audiobrowser/tls/AiaTls.kt +14 -29
- package/android/src/main/java/com/audiobrowser/tls/CachingCertificateFetcher.kt +68 -133
- package/android/src/main/java/com/audiobrowser/util/ArtworkContentProvider.kt +10 -22
- package/android/src/main/java/com/audiobrowser/util/ArtworkRoutes.kt +6 -6
- package/android/src/main/java/com/audiobrowser/util/ArtworkUris.kt +4 -3
- package/android/src/main/java/com/audiobrowser/util/ArtworkVariant.kt +2 -13
- package/android/src/main/java/com/audiobrowser/util/Automotive.kt +2 -4
- package/android/src/main/java/com/audiobrowser/util/BatteryOptimizationHelper.kt +3 -9
- package/android/src/main/java/com/audiobrowser/util/BatteryWarningStore.kt +4 -14
- package/android/src/main/java/com/audiobrowser/util/BrowserPathHelper.kt +21 -85
- package/android/src/main/java/com/audiobrowser/util/CoilArtworkLoader.kt +7 -7
- package/android/src/main/java/com/audiobrowser/util/CoilArtworkLoaderHolder.kt +5 -8
- package/android/src/main/java/com/audiobrowser/util/CoilBitmapLoader.kt +8 -24
- package/android/src/main/java/com/audiobrowser/util/EqualizerManager.kt +7 -39
- package/android/src/main/java/com/audiobrowser/util/MediaExtrasBuilder.kt +10 -14
- package/android/src/main/java/com/audiobrowser/util/MetadataAdapter.kt +5 -9
- package/android/src/main/java/com/audiobrowser/util/NetworkConnectivityMonitor.kt +5 -9
- package/android/src/main/java/com/audiobrowser/util/OutputMonitor.kt +21 -50
- package/android/src/main/java/com/audiobrowser/util/OutputSwitcher.kt +7 -20
- package/android/src/main/java/com/audiobrowser/util/PlayingStateFactory.kt +3 -5
- package/android/src/main/java/com/audiobrowser/util/RatingFavorites.kt +4 -5
- package/android/src/main/java/com/audiobrowser/util/StyleWire.kt +5 -5
- package/android/src/main/java/com/audiobrowser/util/SvgArtworkRenderer.kt +5 -9
- package/android/src/main/java/com/audiobrowser/util/SystemVolumeMonitor.kt +6 -9
- package/android/src/main/java/com/audiobrowser/util/TrackFactory.kt +25 -47
- package/android/src/nocast/java/com/audiobrowser/cast/CastSupport.kt +0 -2
- package/android/src/test/java/com/audiobrowser/ForegroundStartTest.kt +1 -2
- package/android/src/test/java/com/audiobrowser/LegacyRatingTest.kt +3 -3
- package/android/src/test/java/com/audiobrowser/ServiceBindingTest.kt +0 -13
- package/android/src/test/java/com/audiobrowser/ServiceTaskRemovedTest.kt +2 -3
- package/android/src/test/java/com/audiobrowser/TestFixtures.kt +5 -14
- package/android/src/test/java/com/audiobrowser/browser/BrowseArtworkRegistryTest.kt +1 -1
- package/android/src/test/java/com/audiobrowser/browser/BrowserManagerBuildApiRequestTest.kt +2 -8
- package/android/src/test/java/com/audiobrowser/browser/BrowserManagerFavoritesTest.kt +2 -12
- package/android/src/test/java/com/audiobrowser/browser/BrowserManagerLayerResolutionTest.kt +5 -28
- package/android/src/test/java/com/audiobrowser/browser/BrowserManagerTest.kt +11 -43
- package/android/src/test/java/com/audiobrowser/browser/BrowserUrlResolutionTest.kt +4 -13
- package/android/src/test/java/com/audiobrowser/browser/InertStyleDiagnosticTest.kt +2 -11
- package/android/src/test/java/com/audiobrowser/browser/JsonArtworkTest.kt +0 -2
- package/android/src/test/java/com/audiobrowser/browser/JsonStyleTest.kt +3 -8
- package/android/src/test/java/com/audiobrowser/browser/SectionScopeTest.kt +2 -14
- package/android/src/test/java/com/audiobrowser/browser/SimpleRouterTest.kt +1 -5
- package/android/src/test/java/com/audiobrowser/browser/StyleResolverTest.kt +2 -13
- package/android/src/test/java/com/audiobrowser/extension/TappedTrackTest.kt +1 -7
- package/android/src/test/java/com/audiobrowser/extension/TrackIdentityTest.kt +0 -5
- package/android/src/test/java/com/audiobrowser/http/RequestConfigBuilderTest.kt +8 -16
- package/android/src/test/java/com/audiobrowser/model/IcyTitleTest.kt +1 -1
- package/android/src/test/java/com/audiobrowser/player/BrowseTilesTest.kt +12 -29
- package/android/src/test/java/com/audiobrowser/player/CapabilityControlsTest.kt +3 -12
- package/android/src/test/java/com/audiobrowser/player/CrossOriginHeaderStripperTest.kt +0 -7
- package/android/src/test/java/com/audiobrowser/player/DynamicLoadControlTest.kt +0 -1
- package/android/src/test/java/com/audiobrowser/player/EqualizerControllerTest.kt +0 -9
- package/android/src/test/java/com/audiobrowser/player/LiveSeekCommandTest.kt +1 -2
- package/android/src/test/java/com/audiobrowser/player/MediaSessionSlotMappingTest.kt +0 -9
- package/android/src/test/java/com/audiobrowser/player/NowPlayingUpdaterTest.kt +15 -22
- package/android/src/test/java/com/audiobrowser/player/PlaybackErrorClassifierTest.kt +1 -24
- package/android/src/test/java/com/audiobrowser/player/PlaybackStateMachineTest.kt +0 -20
- package/android/src/test/java/com/audiobrowser/player/PlaybackStateStoreTrackJsonTest.kt +1 -6
- package/android/src/test/java/com/audiobrowser/player/PlaybackTimerTest.kt +2 -4
- package/android/src/test/java/com/audiobrowser/player/PlayerCastTest.kt +2 -2
- package/android/src/test/java/com/audiobrowser/player/PlayerEngineFactoryTest.kt +0 -3
- package/android/src/test/java/com/audiobrowser/player/PlayerInvalidTrackTest.kt +0 -1
- package/android/src/test/java/com/audiobrowser/player/PlayerSetupTest.kt +3 -2
- package/android/src/test/java/com/audiobrowser/player/PlayerSonosTest.kt +5 -1
- package/android/src/test/java/com/audiobrowser/player/PlayerSuppressionTest.kt +5 -7
- package/android/src/test/java/com/audiobrowser/player/RetryLoadErrorHandlingPolicyTest.kt +4 -35
- package/android/src/test/java/com/audiobrowser/player/SessionErrorMaskTest.kt +0 -5
- package/android/src/test/java/com/audiobrowser/player/ShuffleOrderLedByTest.kt +1 -8
- package/android/src/test/java/com/audiobrowser/player/StandardSkipTest.kt +4 -6
- package/android/src/test/java/com/audiobrowser/player/StuckRecoveryPolicyTest.kt +11 -11
- package/android/src/test/java/com/audiobrowser/player/TransformingDataSourceTest.kt +2 -23
- package/android/src/test/java/com/audiobrowser/remote/FakeRemote.kt +9 -10
- package/android/src/test/java/com/audiobrowser/remote/RemoteSwitchingPlayerTest.kt +0 -1
- package/android/src/test/java/com/audiobrowser/sonos/DeviceDescriptionParserTest.kt +1 -3
- package/android/src/test/java/com/audiobrowser/sonos/DidlLiteTest.kt +0 -1
- package/android/src/test/java/com/audiobrowser/sonos/SoapClientTest.kt +0 -3
- package/android/src/test/java/com/audiobrowser/sonos/SoapEnvelopesTest.kt +0 -1
- package/android/src/test/java/com/audiobrowser/sonos/SoapResponseParserTest.kt +0 -1
- package/android/src/test/java/com/audiobrowser/sonos/SonosDiscovererTest.kt +2 -0
- package/android/src/test/java/com/audiobrowser/sonos/SonosPlayerTest.kt +0 -1
- package/android/src/test/java/com/audiobrowser/sonos/SonosRemoteTest.kt +1 -1
- package/android/src/test/java/com/audiobrowser/sonos/SonosRoutesTest.kt +2 -0
- package/android/src/test/java/com/audiobrowser/sonos/SonosTransportTest.kt +2 -6
- package/android/src/test/java/com/audiobrowser/sonos/SsdpMessagesTest.kt +0 -2
- package/android/src/test/java/com/audiobrowser/tls/AiaCertChaserTest.kt +13 -37
- package/android/src/test/java/com/audiobrowser/tls/AiaChasingTrustManagerTest.kt +10 -24
- package/android/src/test/java/com/audiobrowser/tls/CachingCertificateFetcherCallSiteTest.kt +15 -39
- package/android/src/test/java/com/audiobrowser/tls/CachingCertificateFetcherTest.kt +4 -10
- package/android/src/test/java/com/audiobrowser/util/ArtworkContentProviderTest.kt +2 -11
- package/android/src/test/java/com/audiobrowser/util/ArtworkUrisTest.kt +0 -1
- package/android/src/test/java/com/audiobrowser/util/BrowserPathHelperTest.kt +0 -4
- package/android/src/test/java/com/audiobrowser/util/CoilArtworkLoaderHolderTest.kt +1 -1
- package/android/src/test/java/com/audiobrowser/util/CoilArtworkLoaderTest.kt +0 -5
- package/android/src/test/java/com/audiobrowser/util/FakeImageLoader.kt +2 -2
- package/android/src/test/java/com/audiobrowser/util/MediaExtrasBuilderTest.kt +4 -12
- package/android/src/test/java/com/audiobrowser/util/OutputMonitorTest.kt +1 -1
- package/android/src/test/java/com/audiobrowser/util/PlayingStateFactoryTest.kt +0 -4
- package/android/src/test/java/com/audiobrowser/util/TrackFactoryBrowseTest.kt +1 -1
- package/android/src/test/java/com/audiobrowser/util/TrackFactoryMediaIdTest.kt +4 -6
- package/android/src/testCast/java/com/audiobrowser/cast/CastEndsTest.kt +1 -1
- package/android/src/testCast/java/com/audiobrowser/cast/SendingMediaItemConverterTest.kt +1 -0
- package/ios/AVPlayerEngine.swift +13 -21
- package/ios/AVPlayerEngineCallbacks.swift +2 -4
- package/ios/Browser/BrowseGate.swift +7 -8
- package/ios/Browser/BrowserConfig.swift +19 -34
- package/ios/Browser/BrowserError.swift +0 -1
- package/ios/Browser/BrowserManager.swift +29 -75
- package/ios/Browser/BrowserPathHelper.swift +13 -93
- package/ios/Browser/FavoriteSet.swift +7 -10
- package/ios/Browser/InertStyleDiagnostic.swift +17 -82
- package/ios/Browser/JsonModels.swift +11 -51
- package/ios/Browser/NavigationErrorState.swift +3 -2
- package/ios/Browser/PageResolver.swift +13 -23
- package/ios/Browser/RequestLayer.swift +16 -20
- package/ios/Browser/RequestPipeline.swift +33 -43
- package/ios/Browser/SearchDrillIn.swift +7 -13
- package/ios/Browser/SectionScope.swift +14 -26
- package/ios/Browser/SimpleRouter.swift +8 -15
- package/ios/Browser/StyleResolver.swift +12 -29
- package/ios/Browser/TabBarEntries.swift +6 -11
- package/ios/Browser/TrackIdTemplate.swift +6 -14
- package/ios/CarPlay/CPInterfaceController+Safe.swift +19 -28
- package/ios/CarPlay/CarPlayArtworkResolver.swift +5 -9
- package/ios/CarPlay/CarPlayController.swift +4 -4
- package/ios/CarPlay/CarPlayImageLoader.swift +11 -26
- package/ios/CarPlay/CarPlayListItemFactory.swift +30 -80
- package/ios/CarPlay/CarPlayNowPlayingManager.swift +19 -54
- package/ios/CarPlay/CarPlaySession+Navigator.swift +10 -10
- package/ios/CarPlay/CarPlaySession+PageLoader.swift +6 -5
- package/ios/CarPlay/CarPlaySession+Refresher.swift +2 -2
- package/ios/CarPlay/CarPlaySession+TabBar.swift +19 -26
- package/ios/CarPlay/CarPlaySession.swift +13 -17
- package/ios/CarPlay/CarPlayTemplates.swift +6 -7
- package/ios/CarPlay/IntentHandlers.swift +3 -5
- package/ios/CarPlay/MediaIntentCriteria.swift +15 -29
- package/ios/CarPlay/MediaIntentHandler.swift +4 -7
- package/ios/CarPlay/MediaIntentPlayback.swift +9 -8
- package/ios/CarPlay/NowPlayingButtonRules.swift +3 -4
- package/ios/CarPlay/SectionPresentation.swift +18 -28
- package/ios/CarPlay/TopTemplateReplacer.swift +8 -9
- package/ios/Extension/Capability+RemoteCommand.swift +3 -3
- package/ios/Extension/ChapterMetadata+AVFoundation.swift +2 -5
- package/ios/Extension/CxxVectorConformances.swift +4 -16
- package/ios/Extension/NavigationError+Conversion.swift +4 -7
- package/ios/Extension/PlayerCapabilities+Favorite.swift +0 -1
- package/ios/Extension/RequestConfig+Copying.swift +2 -6
- package/ios/Extension/ResolvedTrack+Copying.swift +2 -8
- package/ios/Extension/SearchParams+Query.swift +4 -4
- package/ios/Extension/Section+Copying.swift +3 -6
- package/ios/Extension/String+IcyCharset.swift +5 -5
- package/ios/Extension/TimedMetadata+AVFoundation.swift +6 -12
- package/ios/Extension/Track+AVPlayer.swift +1 -2
- package/ios/Extension/Track+Copying.swift +2 -8
- package/ios/Extension/Track+Identity.swift +4 -9
- package/ios/Extension/TrackMetadata+AVFoundation.swift +10 -13
- package/ios/Extension/UIApplication+ActiveScene.swift +6 -14
- package/ios/Extension/Variant+Artwork.swift +8 -22
- package/ios/Http/HttpClient.swift +3 -3
- package/ios/HybridAudioBrowser+Browser.swift +10 -16
- package/ios/HybridAudioBrowser+Options.swift +6 -9
- package/ios/HybridAudioBrowser+Player.swift +8 -16
- package/ios/HybridAudioBrowser+PlayerCallbacks.swift +4 -5
- package/ios/HybridAudioBrowser+Stubs.swift +5 -7
- package/ios/HybridAudioBrowser.swift +54 -79
- package/ios/Model/NitroTypeStubs.swift +15 -22
- package/ios/Model/PlayerUpdateOptions.swift +6 -21
- package/ios/Model/RemoteCommand.swift +2 -2
- package/ios/Model/TrackPlayerError.swift +9 -22
- package/ios/NowPlayingInfo/NowPlayingInfoController.swift +21 -40
- package/ios/NowPlayingInfo/SilentAudioPrimer.swift +10 -16
- package/ios/Observer/ItemObserver.swift +7 -5
- package/ios/Observer/PlayerObserver.swift +5 -5
- package/ios/PlaybackEvent.swift +2 -2
- package/ios/Player/AirPlayStallJudgement.swift +7 -9
- package/ios/Player/AudioSessionController.swift +14 -15
- package/ios/Player/DeferredSeek.swift +2 -2
- package/ios/Player/EndOfTrackJudgement.swift +6 -13
- package/ios/Player/ErrorStatus.swift +8 -7
- package/ios/Player/MediaLoader.swift +20 -24
- package/ios/Player/NowPlayingLines.swift +1 -4
- package/ios/Player/NowPlayingUpdater.swift +35 -61
- package/ios/Player/PersistedPlaybackState.swift +1 -2
- package/ios/Player/PlaybackFailure.swift +20 -24
- package/ios/Player/PlaybackPersistence.swift +5 -6
- package/ios/Player/PlaybackStateMachine.swift +8 -11
- package/ios/Player/PlaybackTimer.swift +8 -11
- package/ios/Player/Player.swift +6 -13
- package/ios/Player/PlayerEngine.swift +20 -20
- package/ios/Player/PlayerStatusTypes.swift +1 -2
- package/ios/Player/QueueManager.swift +23 -67
- package/ios/Player/RetryLoop.swift +39 -50
- package/ios/Player/ShuffleOrder.swift +17 -57
- package/ios/Player/SleepTimerManager.swift +13 -28
- package/ios/Player/VolumeFader.swift +16 -16
- package/ios/RemoteCommand/RemoteCommandCallbacks.swift +6 -16
- package/ios/RemoteCommand/RemoteCommandController.swift +8 -10
- package/ios/Tests/AirPlayStallJudgementTests.swift +4 -4
- package/ios/Tests/BrowserPathHelperTests.swift +3 -6
- package/ios/Tests/DeferredSeekTests.swift +1 -3
- package/ios/Tests/EmitterTests.swift +0 -1
- package/ios/Tests/EndOfTrackJudgementTests.swift +1 -6
- package/ios/Tests/FavoriteSetTests.swift +1 -0
- package/ios/Tests/GenerationMemoTests.swift +2 -2
- package/ios/Tests/InertStyleDiagnosticTests.swift +4 -10
- package/ios/Tests/JsonModelsTests.swift +5 -12
- package/ios/Tests/LRUCacheTests.swift +1 -5
- package/ios/Tests/MediaIntentCriteriaTests.swift +2 -7
- package/ios/Tests/MediaLoaderTests.swift +3 -12
- package/ios/Tests/ObserverTests.swift +3 -3
- package/ios/Tests/PlaybackErrorTests.swift +7 -9
- package/ios/Tests/PlaybackFailureTests.swift +9 -17
- package/ios/Tests/PlaybackPersistenceTests.swift +1 -0
- package/ios/Tests/PlaybackStateMachineTests.swift +1 -16
- package/ios/Tests/PlaybackTimerTests.swift +2 -3
- package/ios/Tests/PlayerPolicyTests.swift +10 -26
- package/ios/Tests/PlayerTests.swift +53 -88
- package/ios/Tests/PlayingStateTests.swift +0 -1
- package/ios/Tests/QueueManagerTests.swift +30 -80
- package/ios/Tests/RemoteCommandControllerTests.swift +5 -13
- package/ios/Tests/ResolvedTrackCopyingTests.swift +0 -2
- package/ios/Tests/RetryLoopTests.swift +12 -35
- package/ios/Tests/SearchDrillInTests.swift +4 -5
- package/ios/Tests/SectionPresentationTests.swift +3 -16
- package/ios/Tests/SectionScopeTests.swift +3 -6
- package/ios/Tests/SimpleRouterTests.swift +1 -5
- package/ios/Tests/SleepTimerManagerTests.swift +8 -11
- package/ios/Tests/StyleResolverTests.swift +4 -13
- package/ios/Tests/Support/ManualSleepTimerScheduler.swift +3 -8
- package/ios/Tests/Support/TestTypes.swift +5 -15
- package/ios/Tests/TabBarEntriesTests.swift +0 -2
- package/ios/Tests/TimedMetadataAVFoundationTests.swift +2 -3
- package/ios/Tests/TopTemplateReplacerTests.swift +1 -1
- package/ios/Tests/TrackIdTemplateTests.swift +2 -6
- package/ios/Tests/TrackMetadataAVFoundationTests.swift +1 -4
- package/ios/Tests/TrackSelectorTests.swift +3 -15
- package/ios/TrackSelector.swift +13 -25
- package/ios/Util/ArtworkFreshness.swift +6 -6
- package/ios/Util/ArtworkImageFetcher.swift +19 -20
- package/ios/Util/ConcurrentMap.swift +2 -2
- package/ios/Util/Emitter.swift +8 -13
- package/ios/Util/NetworkMonitor.swift +4 -6
- package/ios/Util/OutputPicker.swift +1 -1
- package/ios/Util/ReadyValue.swift +3 -2
- package/ios/Util/SFSymbolRenderer.swift +17 -30
- package/ios/Util/SVGProcessor.swift +5 -9
- package/lib/commonjs/CLAUDE.md +7 -2
- package/lib/commonjs/features/battery.js +16 -12
- package/lib/commonjs/features/battery.js.map +1 -1
- package/lib/commonjs/features/browser-config.js +1 -1
- package/lib/commonjs/features/browser.js +74 -24
- package/lib/commonjs/features/browser.js.map +1 -1
- package/lib/commonjs/features/carConnection.js +3 -4
- package/lib/commonjs/features/carConnection.js.map +1 -1
- package/lib/commonjs/features/equalizer.js +9 -5
- package/lib/commonjs/features/equalizer.js.map +1 -1
- package/lib/commonjs/features/errors.js +35 -21
- package/lib/commonjs/features/errors.js.map +1 -1
- package/lib/commonjs/features/favorites.js +15 -13
- package/lib/commonjs/features/favorites.js.map +1 -1
- package/lib/commonjs/features/gate.js +12 -6
- package/lib/commonjs/features/gate.js.map +1 -1
- package/lib/commonjs/features/metadata.js +16 -14
- package/lib/commonjs/features/metadata.js.map +1 -1
- package/lib/commonjs/features/network.js +5 -1
- package/lib/commonjs/features/network.js.map +1 -1
- package/lib/commonjs/features/nowPlaying.js +28 -14
- package/lib/commonjs/features/nowPlaying.js.map +1 -1
- package/lib/commonjs/features/output.js +8 -4
- package/lib/commonjs/features/output.js.map +1 -1
- package/lib/commonjs/features/playback/controls.js +10 -5
- package/lib/commonjs/features/playback/controls.js.map +1 -1
- package/lib/commonjs/features/playback/playWhenReady.js +6 -5
- package/lib/commonjs/features/playback/playWhenReady.js.map +1 -1
- package/lib/commonjs/features/playback/playing.js +5 -3
- package/lib/commonjs/features/playback/playing.js.map +1 -1
- package/lib/commonjs/features/playback/progress.js +11 -5
- package/lib/commonjs/features/playback/progress.js.map +1 -1
- package/lib/commonjs/features/playback/state.js +3 -3
- package/lib/commonjs/features/playback/state.js.map +1 -1
- package/lib/commonjs/features/playback/trackPlaybackTime.js +6 -1
- package/lib/commonjs/features/playback/trackPlaybackTime.js.map +1 -1
- package/lib/commonjs/features/playback/volume.js +6 -5
- package/lib/commonjs/features/playback/volume.js.map +1 -1
- package/lib/commonjs/features/player/options.js +20 -10
- package/lib/commonjs/features/player/options.js.map +1 -1
- package/lib/commonjs/features/player/setup.js +34 -38
- package/lib/commonjs/features/player/setup.js.map +1 -1
- package/lib/commonjs/features/queue/activeTrack.js +0 -1
- package/lib/commonjs/features/queue/activeTrack.js.map +1 -1
- package/lib/commonjs/features/queue/queue.js +48 -20
- package/lib/commonjs/features/queue/queue.js.map +1 -1
- package/lib/commonjs/features/queue/repeatMode.js +2 -1
- package/lib/commonjs/features/queue/repeatMode.js.map +1 -1
- package/lib/commonjs/features/queue/shuffle.js +0 -1
- package/lib/commonjs/features/queue/shuffle.js.map +1 -1
- package/lib/commonjs/features/remoteControls.js +59 -35
- package/lib/commonjs/features/remoteControls.js.map +1 -1
- package/lib/commonjs/features/sleepTimer.js +15 -6
- package/lib/commonjs/features/sleepTimer.js.map +1 -1
- package/lib/commonjs/utils/LazyNativeEmitter.js +6 -9
- package/lib/commonjs/utils/LazyNativeEmitter.js.map +1 -1
- package/lib/commonjs/utils/NativeUpdatedValue.js +13 -12
- package/lib/commonjs/utils/NativeUpdatedValue.js.map +1 -1
- package/lib/commonjs/utils/getTrackIdentity.js +6 -4
- package/lib/commonjs/utils/getTrackIdentity.js.map +1 -1
- package/lib/commonjs/utils/useDebug.js +16 -3
- package/lib/commonjs/utils/useDebug.js.map +1 -1
- package/lib/commonjs/web/NativeAudioBrowser.js +2 -4
- package/lib/commonjs/web/NativeAudioBrowser.js.map +1 -1
- package/lib/commonjs/web/browser/parseSearchResponse.js +3 -4
- package/lib/commonjs/web/browser/parseSearchResponse.js.map +1 -1
- package/lib/commonjs/web/browser/sections.js +1 -1
- package/lib/commonjs/web/util/BrowserPathHelper.js +1 -3
- package/lib/commonjs/web/util/BrowserPathHelper.js.map +1 -1
- package/lib/module/CLAUDE.md +7 -2
- package/lib/module/features/battery.js +16 -12
- package/lib/module/features/battery.js.map +1 -1
- package/lib/module/features/browser-config.js +1 -1
- package/lib/module/features/browser.js +74 -24
- package/lib/module/features/browser.js.map +1 -1
- package/lib/module/features/carConnection.js +3 -4
- package/lib/module/features/carConnection.js.map +1 -1
- package/lib/module/features/equalizer.js +9 -5
- package/lib/module/features/equalizer.js.map +1 -1
- package/lib/module/features/errors.js +35 -21
- package/lib/module/features/errors.js.map +1 -1
- package/lib/module/features/favorites.js +15 -13
- package/lib/module/features/favorites.js.map +1 -1
- package/lib/module/features/gate.js +12 -6
- package/lib/module/features/gate.js.map +1 -1
- package/lib/module/features/metadata.js +16 -14
- package/lib/module/features/metadata.js.map +1 -1
- package/lib/module/features/network.js +5 -1
- package/lib/module/features/network.js.map +1 -1
- package/lib/module/features/nowPlaying.js +28 -14
- package/lib/module/features/nowPlaying.js.map +1 -1
- package/lib/module/features/output.js +8 -4
- package/lib/module/features/output.js.map +1 -1
- package/lib/module/features/playback/controls.js +10 -5
- package/lib/module/features/playback/controls.js.map +1 -1
- package/lib/module/features/playback/playWhenReady.js +6 -5
- package/lib/module/features/playback/playWhenReady.js.map +1 -1
- package/lib/module/features/playback/playing.js +5 -3
- package/lib/module/features/playback/playing.js.map +1 -1
- package/lib/module/features/playback/progress.js +11 -5
- package/lib/module/features/playback/progress.js.map +1 -1
- package/lib/module/features/playback/state.js +3 -3
- package/lib/module/features/playback/state.js.map +1 -1
- package/lib/module/features/playback/trackPlaybackTime.js +6 -1
- package/lib/module/features/playback/trackPlaybackTime.js.map +1 -1
- package/lib/module/features/playback/volume.js +6 -5
- package/lib/module/features/playback/volume.js.map +1 -1
- package/lib/module/features/player/options.js +20 -10
- package/lib/module/features/player/options.js.map +1 -1
- package/lib/module/features/player/setup.js +34 -38
- package/lib/module/features/player/setup.js.map +1 -1
- package/lib/module/features/queue/activeTrack.js +0 -1
- package/lib/module/features/queue/activeTrack.js.map +1 -1
- package/lib/module/features/queue/queue.js +48 -20
- package/lib/module/features/queue/queue.js.map +1 -1
- package/lib/module/features/queue/repeatMode.js +2 -1
- package/lib/module/features/queue/repeatMode.js.map +1 -1
- package/lib/module/features/queue/shuffle.js +0 -1
- package/lib/module/features/queue/shuffle.js.map +1 -1
- package/lib/module/features/remoteControls.js +59 -35
- package/lib/module/features/remoteControls.js.map +1 -1
- package/lib/module/features/sleepTimer.js +15 -6
- package/lib/module/features/sleepTimer.js.map +1 -1
- package/lib/module/utils/LazyNativeEmitter.js +6 -9
- package/lib/module/utils/LazyNativeEmitter.js.map +1 -1
- package/lib/module/utils/NativeUpdatedValue.js +13 -12
- package/lib/module/utils/NativeUpdatedValue.js.map +1 -1
- package/lib/module/utils/getTrackIdentity.js +6 -4
- package/lib/module/utils/getTrackIdentity.js.map +1 -1
- package/lib/module/utils/useDebug.js +16 -3
- package/lib/module/utils/useDebug.js.map +1 -1
- package/lib/module/web/NativeAudioBrowser.js +2 -4
- package/lib/module/web/NativeAudioBrowser.js.map +1 -1
- package/lib/module/web/browser/parseSearchResponse.js +3 -4
- package/lib/module/web/browser/parseSearchResponse.js.map +1 -1
- package/lib/module/web/browser/sections.js +1 -1
- package/lib/module/web/util/BrowserPathHelper.js +1 -3
- package/lib/module/web/util/BrowserPathHelper.js.map +1 -1
- package/lib/typescript/src/features/battery.d.ts +17 -12
- package/lib/typescript/src/features/battery.d.ts.map +1 -1
- package/lib/typescript/src/features/browser.d.ts +64 -24
- package/lib/typescript/src/features/browser.d.ts.map +1 -1
- package/lib/typescript/src/features/carConnection.d.ts +3 -4
- package/lib/typescript/src/features/carConnection.d.ts.map +1 -1
- package/lib/typescript/src/features/equalizer.d.ts +9 -5
- package/lib/typescript/src/features/equalizer.d.ts.map +1 -1
- package/lib/typescript/src/features/errors.d.ts +37 -22
- package/lib/typescript/src/features/errors.d.ts.map +1 -1
- package/lib/typescript/src/features/favorites.d.ts +15 -13
- package/lib/typescript/src/features/favorites.d.ts.map +1 -1
- package/lib/typescript/src/features/gate.d.ts +14 -8
- package/lib/typescript/src/features/gate.d.ts.map +1 -1
- package/lib/typescript/src/features/metadata.d.ts +37 -17
- package/lib/typescript/src/features/metadata.d.ts.map +1 -1
- package/lib/typescript/src/features/network.d.ts +5 -1
- package/lib/typescript/src/features/network.d.ts.map +1 -1
- package/lib/typescript/src/features/nowPlaying.d.ts +28 -14
- package/lib/typescript/src/features/nowPlaying.d.ts.map +1 -1
- package/lib/typescript/src/features/output.d.ts +8 -4
- package/lib/typescript/src/features/output.d.ts.map +1 -1
- package/lib/typescript/src/features/playback/controls.d.ts +10 -5
- package/lib/typescript/src/features/playback/controls.d.ts.map +1 -1
- package/lib/typescript/src/features/playback/playWhenReady.d.ts +6 -5
- package/lib/typescript/src/features/playback/playWhenReady.d.ts.map +1 -1
- package/lib/typescript/src/features/playback/playing.d.ts +16 -3
- package/lib/typescript/src/features/playback/playing.d.ts.map +1 -1
- package/lib/typescript/src/features/playback/progress.d.ts +11 -5
- package/lib/typescript/src/features/playback/progress.d.ts.map +1 -1
- package/lib/typescript/src/features/playback/state.d.ts +8 -3
- package/lib/typescript/src/features/playback/state.d.ts.map +1 -1
- package/lib/typescript/src/features/playback/trackPlaybackTime.d.ts +9 -2
- package/lib/typescript/src/features/playback/trackPlaybackTime.d.ts.map +1 -1
- package/lib/typescript/src/features/playback/volume.d.ts +6 -5
- package/lib/typescript/src/features/playback/volume.d.ts.map +1 -1
- package/lib/typescript/src/features/player/options.d.ts +52 -37
- package/lib/typescript/src/features/player/options.d.ts.map +1 -1
- package/lib/typescript/src/features/player/setup.d.ts +65 -60
- package/lib/typescript/src/features/player/setup.d.ts.map +1 -1
- package/lib/typescript/src/features/queue/activeTrack.d.ts +0 -1
- package/lib/typescript/src/features/queue/activeTrack.d.ts.map +1 -1
- package/lib/typescript/src/features/queue/queue.d.ts +48 -20
- package/lib/typescript/src/features/queue/queue.d.ts.map +1 -1
- package/lib/typescript/src/features/queue/repeatMode.d.ts +1 -1
- package/lib/typescript/src/features/queue/repeatMode.d.ts.map +1 -1
- package/lib/typescript/src/features/queue/shuffle.d.ts +0 -1
- package/lib/typescript/src/features/queue/shuffle.d.ts.map +1 -1
- package/lib/typescript/src/features/remoteControls.d.ts +58 -25
- package/lib/typescript/src/features/remoteControls.d.ts.map +1 -1
- package/lib/typescript/src/features/sleepTimer.d.ts +15 -7
- package/lib/typescript/src/features/sleepTimer.d.ts.map +1 -1
- package/lib/typescript/src/types/browser-nodes.d.ts +54 -57
- package/lib/typescript/src/types/browser-nodes.d.ts.map +1 -1
- package/lib/typescript/src/types/browser.d.ts +181 -144
- package/lib/typescript/src/types/browser.d.ts.map +1 -1
- package/lib/typescript/src/utils/LazyNativeEmitter.d.ts +6 -9
- package/lib/typescript/src/utils/LazyNativeEmitter.d.ts.map +1 -1
- package/lib/typescript/src/utils/NativeUpdatedValue.d.ts +13 -12
- package/lib/typescript/src/utils/NativeUpdatedValue.d.ts.map +1 -1
- package/lib/typescript/src/utils/getTrackIdentity.d.ts +6 -4
- package/lib/typescript/src/utils/getTrackIdentity.d.ts.map +1 -1
- package/lib/typescript/src/utils/useDebug.d.ts +16 -3
- package/lib/typescript/src/utils/useDebug.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/CLAUDE.md +7 -2
- package/src/docs-floors.test.ts +71 -0
- package/src/features/battery.ts +17 -13
- package/src/features/browser-config.ts +1 -1
- package/src/features/browser.ts +65 -24
- package/src/features/carConnection.ts +3 -4
- package/src/features/equalizer.ts +9 -5
- package/src/features/errors.ts +37 -22
- package/src/features/favorites.ts +15 -13
- package/src/features/gate.ts +14 -8
- package/src/features/metadata.ts +37 -17
- package/src/features/network.ts +5 -1
- package/src/features/nowPlaying.ts +28 -14
- package/src/features/output.ts +8 -4
- package/src/features/playback/controls.ts +10 -5
- package/src/features/playback/playWhenReady.ts +6 -5
- package/src/features/playback/playing.ts +16 -3
- package/src/features/playback/progress.ts +11 -5
- package/src/features/playback/state.ts +8 -3
- package/src/features/playback/trackPlaybackTime.ts +9 -2
- package/src/features/playback/volume.ts +6 -5
- package/src/features/player/options.ts +54 -43
- package/src/features/player/setup.ts +67 -61
- package/src/features/queue/activeTrack.ts +0 -1
- package/src/features/queue/queue.ts +48 -20
- package/src/features/queue/repeatMode.ts +1 -1
- package/src/features/queue/shuffle.ts +0 -1
- package/src/features/remoteControls.ts +59 -35
- package/src/features/sleepTimer.ts +15 -7
- package/src/types/browser-nodes.ts +54 -57
- package/src/types/browser.ts +183 -146
- package/src/utils/LazyNativeEmitter.ts +6 -9
- package/src/utils/NativeUpdatedValue.ts +13 -12
- package/src/utils/getTrackIdentity.ts +6 -4
- package/src/utils/useDebug.ts +16 -3
- package/src/web/NativeAudioBrowser.ts +2 -4
- package/src/web/browser/parseSearchResponse.ts +3 -4
- package/src/web/browser/sections.ts +1 -1
- package/src/web/util/BrowserPathHelper.ts +1 -3
- package/website/guide/android-auto.md +25 -13
- package/website/guide/android-certificates.md +199 -120
- package/website/guide/artwork.md +93 -48
- package/website/guide/audio-output.md +86 -68
- package/website/guide/automotive.md +15 -10
- package/website/guide/basic-usage.md +5 -2
- package/website/guide/battery.md +50 -23
- package/website/guide/browser.md +155 -68
- package/website/guide/carplay.md +132 -49
- package/website/guide/configuration.md +85 -49
- package/website/guide/equalizer.md +36 -32
- package/website/guide/errors.md +106 -64
- package/website/guide/favorites.md +41 -31
- package/website/guide/gate.md +24 -10
- package/website/guide/getting-started.md +55 -2
- package/website/guide/hooks.md +53 -47
- package/website/guide/live-streams.md +80 -49
- package/website/guide/metadata.md +87 -53
- package/website/guide/migrating-from-track-player.md +94 -49
- package/website/guide/native-callback-fetch.md +46 -36
- package/website/guide/network.md +36 -20
- package/website/guide/now-playing.md +72 -44
- package/website/guide/playback.md +112 -35
- package/website/guide/queue.md +77 -43
- package/website/guide/remote-controls.md +87 -29
- package/website/guide/search.md +37 -22
- package/website/guide/sleep-timer.md +35 -14
- package/website/guide/track.md +59 -35
|
@@ -7,8 +7,8 @@ import type { AndroidUpdateOptions, IOSUpdateOptions, UpdateOptions } from './op
|
|
|
7
7
|
* Parameters passed to the {@link FormatNowPlayingCallback}.
|
|
8
8
|
*
|
|
9
9
|
* The formatter owns every line shown on the now-playing surface — the track text, the live song,
|
|
10
|
-
* *and* any transient status (reconnecting / error). The library no
|
|
11
|
-
*
|
|
10
|
+
* *and* any transient status (reconnecting / error). The library renders no status text; these
|
|
11
|
+
* fields let you render (and localize) it yourself. The formatter
|
|
12
12
|
* is re-invoked on track change, each timed-metadata update, play/pause + error/rebuffer
|
|
13
13
|
* transitions, and device connectivity changes.
|
|
14
14
|
*/
|
|
@@ -17,6 +17,7 @@ export type FormatNowPlayingParams = {
|
|
|
17
17
|
track: Track;
|
|
18
18
|
/**
|
|
19
19
|
* Timed metadata (ICY / ID3 "now playing song") received during playback, if any.
|
|
20
|
+
* On iOS, also a file's own tags when the file has no chapters.
|
|
20
21
|
* Always `undefined` on web — see `onTimedMetadata` for why.
|
|
21
22
|
*/
|
|
22
23
|
timedMetadata?: TimedMetadata;
|
|
@@ -45,44 +46,28 @@ export type StallReason = 'buffering' | 'offline';
|
|
|
45
46
|
* Customizes what's rendered on the now-playing surface — lock screen, notification, Control Center,
|
|
46
47
|
* CarPlay, and Android Auto — for the currently playing track.
|
|
47
48
|
*
|
|
48
|
-
* Configure it via {@link SetupPlayerOptions.nowPlaying}.
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* transient status line ("Reconnecting…", an error message), drop the song while paused — anything
|
|
52
|
-
* you can derive from the {@link FormatNowPlayingParams} for that moment.
|
|
49
|
+
* Configure it via {@link SetupPlayerOptions.nowPlaying}. It is re-invoked on track change, each
|
|
50
|
+
* timed-metadata update and every playback transition; identical results are de-duplicated
|
|
51
|
+
* natively, so they don't flicker the surface.
|
|
53
52
|
*
|
|
54
|
-
* The callback is **synchronous
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* ### When it's invoked
|
|
59
|
-
* The player re-invokes the formatter whenever the now-playing could change:
|
|
60
|
-
* - on track change (a new item becomes current);
|
|
61
|
-
* - on each timed-metadata update ({@link FormatNowPlayingParams.timedMetadata} arrives or changes);
|
|
62
|
-
* - on every playback transition — play / pause, a stall starting or recovering, an error.
|
|
63
|
-
*
|
|
64
|
-
* Identical results are de-duplicated natively before they reach the media session, so returning the
|
|
65
|
-
* same fields across a rapid burst of transitions is cheap and won't flicker the surface.
|
|
66
|
-
*
|
|
67
|
-
* ### What to return
|
|
68
|
-
* Return a {@link NowPlayingUpdate} with the fields to display. Each field falls back **independently**
|
|
69
|
-
* to the track's own value when omitted — so `{ artist: 'Some Song' }` replaces only the secondary
|
|
70
|
-
* line and leaves the title as the track's title. Return `undefined` (or `{}`) to use the library
|
|
71
|
-
* default entirely (the track's own `title` / `artist`).
|
|
72
|
-
*
|
|
73
|
-
* @param params - The current track, latest timed metadata, and playback signals for this moment
|
|
74
|
-
* ({@link FormatNowPlayingParams}), including a {@link StallReason} that already classifies an
|
|
75
|
-
* offline stall — no separate connectivity read needed for the now-playing line.
|
|
76
|
-
* @returns The now-playing fields to display, or `undefined` to fall back to the track's own
|
|
77
|
-
* `title` / `artist`.
|
|
53
|
+
* The callback is **synchronous**, run on the JS thread and awaited natively: no I/O in it.
|
|
54
|
+
* Each returned field falls back **independently** to the track's own value, so
|
|
55
|
+
* `{ artist: 'Some Song' }` replaces only the secondary line; `undefined` (or `{}`) keeps the
|
|
56
|
+
* track's own `title` / `artist`. See the [Now playing guide](https://audiobrowser.dev/guide/now-playing).
|
|
78
57
|
*
|
|
79
58
|
* @example
|
|
80
59
|
* ```ts
|
|
81
60
|
* setupPlayer({
|
|
82
61
|
* nowPlaying: ({ timedMetadata, playWhenReady, stalled, error }) => {
|
|
83
62
|
* if (error) return { artist: error.message ?? 'Playback error' }
|
|
84
|
-
* if (stalled)
|
|
85
|
-
*
|
|
63
|
+
* if (stalled) {
|
|
64
|
+
* return {
|
|
65
|
+
* artist: stalled === 'offline'
|
|
66
|
+
* ? 'No internet connection'
|
|
67
|
+
* : 'Reconnecting…'
|
|
68
|
+
* }
|
|
69
|
+
* }
|
|
70
|
+
* // Show the live song only while playing; else use the track default.
|
|
86
71
|
* if (!playWhenReady || !timedMetadata?.title) return
|
|
87
72
|
* return {
|
|
88
73
|
* artist: timedMetadata.artist
|
|
@@ -131,7 +116,8 @@ export type AndroidAudioContentType = 'music' | 'speech' | 'sonification' | 'mov
|
|
|
131
116
|
* - `'ambient'`: The category for an app in which sound playback is nonprimary
|
|
132
117
|
* — that is, your app also works with the sound turned off. See
|
|
133
118
|
* https://developer.apple.com/documentation/avfaudio/avaudiosession/category/1616560-ambient
|
|
134
|
-
* - `'soloAmbient'`: The default audio session category
|
|
119
|
+
* - `'soloAmbient'`: The system's default audio session category; the library
|
|
120
|
+
* uses `'playback'` when `category` is omitted. See
|
|
135
121
|
* https://developer.apple.com/documentation/avfaudio/avaudiosession/category/1616488-soloambient
|
|
136
122
|
* - `'record'`: The category for recording audio while also silencing playback
|
|
137
123
|
* audio. See
|
|
@@ -205,17 +191,23 @@ export type IOSCategoryOptions = 'mixWithOthers' | 'duckOthers' | 'interruptSpok
|
|
|
205
191
|
* https://developer.apple.com/documentation/avfoundation/avaudiosession/routesharingpolicy/longformvideo
|
|
206
192
|
*/
|
|
207
193
|
export type IOSCategoryPolicy = 'default' | 'longFormAudio' | 'longFormVideo';
|
|
194
|
+
/**
|
|
195
|
+
* Requirements for Android audio offload; see `audioOffload`.
|
|
196
|
+
* @platform android
|
|
197
|
+
*/
|
|
208
198
|
export interface AndroidAudioOffloadSettings {
|
|
209
199
|
/**
|
|
210
200
|
* Whether gapless playback support is required for offload.
|
|
211
201
|
* Enables smooth transitions between tracks without silence gaps.
|
|
212
|
-
*
|
|
202
|
+
* Omitting it here means not required; `audioOffload: true` requires it.
|
|
203
|
+
* @default false
|
|
213
204
|
*/
|
|
214
205
|
gaplessSupportRequired?: boolean;
|
|
215
206
|
/**
|
|
216
207
|
* Whether playback rate change support is required for offload.
|
|
217
208
|
* Enables variable playback speeds (0.5x, 1.25x, 2x, etc.) during offload.
|
|
218
|
-
*
|
|
209
|
+
* Omitting it here means not required; `audioOffload: true` requires it.
|
|
210
|
+
* @default false
|
|
219
211
|
*/
|
|
220
212
|
rateChangeSupportRequired?: boolean;
|
|
221
213
|
}
|
|
@@ -283,8 +275,8 @@ export type AndroidPlayerWakeMode = 'none' | 'local' | 'network';
|
|
|
283
275
|
export interface AndroidSetupOptions extends AndroidUpdateOptions {
|
|
284
276
|
/**
|
|
285
277
|
* Minimum duration of media that the player will attempt to buffer in ms.
|
|
278
|
+
* Has no effect: the player keeps loading until `maxBuffer` is buffered.
|
|
286
279
|
*
|
|
287
|
-
* @throws Will throw if min buffer is higher than max buffer.
|
|
288
280
|
* @default 50000
|
|
289
281
|
*/
|
|
290
282
|
minBuffer?: number;
|
|
@@ -296,17 +288,16 @@ export interface AndroidSetupOptions extends AndroidUpdateOptions {
|
|
|
296
288
|
*
|
|
297
289
|
* - `true`: Enable with default settings (gapless + rate change support required)
|
|
298
290
|
* - `false`/`undefined`: Disabled
|
|
299
|
-
* - `{ gaplessSupportRequired
|
|
300
|
-
* Enable with specific requirements for gapless playback and playback rate changes
|
|
291
|
+
* - `{ gaplessSupportRequired?: boolean, rateChangeSupportRequired?: boolean }`:
|
|
292
|
+
* Enable with specific requirements for gapless playback and playback rate changes;
|
|
293
|
+
* an omitted field is not required, so `{}` enables offload with no requirements
|
|
301
294
|
*
|
|
302
295
|
* @default false
|
|
303
296
|
*/
|
|
304
297
|
audioOffload?: boolean | AndroidAudioOffloadSettings;
|
|
305
298
|
/**
|
|
306
299
|
* Maximum duration of media that the player will attempt to buffer in ms.
|
|
307
|
-
* Max buffer may not be lower than min buffer.
|
|
308
300
|
*
|
|
309
|
-
* @throws Will throw if max buffer is lower than min buffer.
|
|
310
301
|
* @default 50000
|
|
311
302
|
*/
|
|
312
303
|
maxBuffer?: number;
|
|
@@ -321,7 +312,7 @@ export interface AndroidSetupOptions extends AndroidUpdateOptions {
|
|
|
321
312
|
* Duration of media in ms that must be buffered for playback to start or
|
|
322
313
|
* resume following a user action such as a seek.
|
|
323
314
|
*
|
|
324
|
-
* @default
|
|
315
|
+
* @default 1000 (media3's `DEFAULT_BUFFER_FOR_PLAYBACK_MS`)
|
|
325
316
|
*/
|
|
326
317
|
playBuffer?: number;
|
|
327
318
|
/**
|
|
@@ -331,7 +322,6 @@ export interface AndroidSetupOptions extends AndroidUpdateOptions {
|
|
|
331
322
|
* When null (the default), uses automatic mode:
|
|
332
323
|
* - Starts at `playBuffer` value
|
|
333
324
|
* - On rebuffer, measures how fast the buffer drained
|
|
334
|
-
* - Calculates how much buffer is needed to sustain 60s of playback
|
|
335
325
|
* - Increases threshold accordingly (up to 8000ms max)
|
|
336
326
|
* - Resets when changing tracks
|
|
337
327
|
*
|
|
@@ -352,11 +342,11 @@ export interface AndroidSetupOptions extends AndroidUpdateOptions {
|
|
|
352
342
|
* The audio content type indicates to the android system how
|
|
353
343
|
* you intend to use audio in your app.
|
|
354
344
|
*
|
|
355
|
-
* With `audioContentType:
|
|
345
|
+
* With `audioContentType: 'speech'`, the audio will be
|
|
356
346
|
* paused during short interruptions, such as when a message arrives.
|
|
357
347
|
* Otherwise the playback volume is reduced while the notification is playing.
|
|
358
348
|
*
|
|
359
|
-
* @default
|
|
349
|
+
* @default 'music'
|
|
360
350
|
*/
|
|
361
351
|
audioContentType?: AndroidAudioContentType;
|
|
362
352
|
/**
|
|
@@ -391,7 +381,10 @@ export interface IOSSetupOptions extends IOSUpdateOptions {
|
|
|
391
381
|
buffer?: number;
|
|
392
382
|
/**
|
|
393
383
|
* [AVAudioSession.Category](https://developer.apple.com/documentation/avfoundation/avaudiosession/1616615-category)
|
|
394
|
-
* for iOS.
|
|
384
|
+
* for iOS. Applied at `setupPlayer`; the session is activated when playback
|
|
385
|
+
* starts.
|
|
386
|
+
*
|
|
387
|
+
* @default 'playback'
|
|
395
388
|
*/
|
|
396
389
|
category?: IOSCategory;
|
|
397
390
|
/**
|
|
@@ -399,19 +392,25 @@ export interface IOSSetupOptions extends IOSUpdateOptions {
|
|
|
399
392
|
* indicates to the system how you intend to use audio in your app. You can use
|
|
400
393
|
* a mode to configure the audio system for specific use cases such as video
|
|
401
394
|
* recording, voice or video chat, or audio analysis.
|
|
402
|
-
*
|
|
395
|
+
* Applied at `setupPlayer`; the session is activated when playback starts.
|
|
403
396
|
*
|
|
404
397
|
* See https://developer.apple.com/documentation/avfoundation/avaudiosession/1616508-mode
|
|
398
|
+
*
|
|
399
|
+
* @default 'default'
|
|
405
400
|
*/
|
|
406
401
|
categoryMode?: IOSCategoryMode;
|
|
407
402
|
/**
|
|
408
403
|
* [AVAudioSession.CategoryOptions](https://developer.apple.com/documentation/avfoundation/avaudiosession/1616503-categoryoptions) for iOS.
|
|
409
|
-
*
|
|
404
|
+
* Applied at `setupPlayer`; the session is activated when playback starts.
|
|
405
|
+
*
|
|
406
|
+
* @default []
|
|
410
407
|
*/
|
|
411
408
|
categoryOptions?: IOSCategoryOptions[];
|
|
412
409
|
/**
|
|
413
410
|
* [AVAudioSession.RouteSharingPolicy](https://developer.apple.com/documentation/AVFAudio/AVAudioSession/RouteSharingPolicy-swift.enum) for iOS.
|
|
414
|
-
*
|
|
411
|
+
* Applied at `setupPlayer`; the session is activated when playback starts.
|
|
412
|
+
*
|
|
413
|
+
* @default 'default'
|
|
415
414
|
*/
|
|
416
415
|
categoryPolicy?: IOSCategoryPolicy;
|
|
417
416
|
}
|
|
@@ -469,20 +468,22 @@ export type SetupPlayerOptions = Pick<UpdateOptions, 'capabilities' | 'forwardJu
|
|
|
469
468
|
/**
|
|
470
469
|
* Retry policy for load errors (network failures, timeouts, etc.)
|
|
471
470
|
* - `true`: Retry indefinitely with exponential backoff, under the default
|
|
472
|
-
* duration budgets
|
|
473
|
-
*
|
|
474
|
-
*
|
|
471
|
+
* duration budgets of {@link RetryConfig}
|
|
472
|
+
* - `false`/`undefined`: no library retry. Android keeps media3's default
|
|
473
|
+
* handling, which retries a failed load a few times before surfacing the
|
|
474
|
+
* error; iOS fails at once.
|
|
475
475
|
* - `{ maxRetries: n }`: Retry up to n times with exponential backoff
|
|
476
476
|
* - `RetryConfig`: custom attempt and duration budgets
|
|
477
477
|
*
|
|
478
|
-
*
|
|
478
|
+
* Backoff timing and budgets: see the
|
|
479
|
+
* [Errors guide](https://audiobrowser.dev/guide/errors#two-duration-budgets).
|
|
479
480
|
*
|
|
480
481
|
* @default false
|
|
481
482
|
*/
|
|
482
483
|
retry?: boolean | RetryConfig;
|
|
483
484
|
/**
|
|
484
485
|
* Keep the media session alive and controllable through a terminal playback error (e.g. a dead
|
|
485
|
-
* stream), so
|
|
486
|
+
* stream), so External Surfaces such as Android Auto keep their transport controls
|
|
486
487
|
* (next / previous) instead of tearing the session down. The error is still reported via
|
|
487
488
|
* `onPlaybackError` / `playbackState`; this only affects what the OS media session observes.
|
|
488
489
|
*
|
|
@@ -504,7 +505,7 @@ export type SetupPlayerOptions = Pick<UpdateOptions, 'capabilities' | 'forwardJu
|
|
|
504
505
|
* Each `setupPlayer` sets it: left out, remote outputs are off, and playback on one comes back
|
|
505
506
|
* to the phone.
|
|
506
507
|
*
|
|
507
|
-
* Android 11
|
|
508
|
+
* Android 11+; ignored on iOS, whose route picker already lists AirPlay devices.
|
|
508
509
|
* @default off
|
|
509
510
|
*/
|
|
510
511
|
remoteOutputs?: RemoteOutputsOptions;
|
|
@@ -519,8 +520,7 @@ export type SetupPlayerOptions = Pick<UpdateOptions, 'capabilities' | 'forwardJu
|
|
|
519
520
|
* - `true` (default): publish the track's own title / artist.
|
|
520
521
|
* - `false`: don't manage the now-playing metadata at all.
|
|
521
522
|
* - a {@link FormatNowPlayingCallback}: render it yourself — the callback owns every line,
|
|
522
|
-
* including any transient status (buffering / reconnecting / offline / error)
|
|
523
|
-
* library no longer renders on your behalf.
|
|
523
|
+
* including any transient status (buffering / reconnecting / offline / error).
|
|
524
524
|
*
|
|
525
525
|
* @default true
|
|
526
526
|
*/
|
|
@@ -533,9 +533,14 @@ export type SetupPlayerOptions = Pick<UpdateOptions, 'capabilities' | 'forwardJu
|
|
|
533
533
|
* natively as part of setup itself, so there is no setup-then-command ordering for consumers
|
|
534
534
|
* to know about, and no window where the player exists without its options.
|
|
535
535
|
*
|
|
536
|
-
* Calling it again
|
|
537
|
-
*
|
|
538
|
-
*
|
|
536
|
+
* Calling it again is how a setup-only option changes after launch, and works differently per
|
|
537
|
+
* platform. On Android, newly provided fields are merged over the previous ones, except
|
|
538
|
+
* `remoteOutputs`, which is off when left out, and `nowPlaying`, which is on when left out
|
|
539
|
+
* and keeps an earlier formatter until a call passes another one. The audio engine is rebuilt
|
|
540
|
+
* only when construction-bound fields (buffers, wake mode, …) changed. On iOS, each call
|
|
541
|
+
* replaces the player: the queue is cleared, and setup-only fields you omit (`ios` session
|
|
542
|
+
* category and `buffer`, `retry`, …) go back to their defaults. Runtime options set earlier
|
|
543
|
+
* carry over on both.
|
|
539
544
|
*
|
|
540
545
|
* @param options - The options to initialize the player with.
|
|
541
546
|
*
|
|
@@ -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,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,qBAAqB,GACrB,sBAAsB,GACtB,6BAA6B,CAChC,GAAG;IACF;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,UAAU,CAAA;IAEvB;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,WAAW,CAAA;IAE7B;;;;;;;;;;OAUG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAA;IAEjC;;;;;;;;;;;;;;OAcG;IACH,aAAa,CAAC,EAAE,oBAAoB,CAAA;IAEpC,yEAAyE;IACzE,OAAO,CAAC,EAAE,mBAAmB,CAAA;IAC7B,+DAA+D;IAC/D,GAAG,CAAC,EAAE,eAAe,CAAA;IACrB;;;;;;;;;;OAUG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,wBAAwB,CAAA;CAChD,CAAA;AAkED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,WAAW,CAC/B,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CA2Df"}
|
|
@@ -32,7 +32,6 @@ export declare function getActiveTrackIndex(): number | undefined;
|
|
|
32
32
|
* {@link onFavoriteChanged} instead; {@link useActiveTrack} subscribes to
|
|
33
33
|
* both, so UI bound through the hook still re-renders on a heart toggle.
|
|
34
34
|
*
|
|
35
|
-
* @param callback - Called when the active track changes
|
|
36
35
|
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
37
36
|
*/
|
|
38
37
|
export declare const onActiveTrackChanged: NativeUpdatedValue<PlaybackActiveTrackChangedEvent>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activeTrack.d.ts","sourceRoot":"","sources":["../../../../../src/features/queue/activeTrack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAInE;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4FAA4F;IAC5F,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,8DAA8D;IAC9D,YAAY,EAAE,MAAM,CAAA;IACpB,uFAAuF;IACvF,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iFAAiF;IACjF,KAAK,CAAC,EAAE,KAAK,CAAA;CACd;AAID;;GAEG;AACH,wBAAgB,cAAc,IAAI,KAAK,GAAG,SAAS,CAElD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,GAAG,SAAS,CAExD;AAID
|
|
1
|
+
{"version":3,"file":"activeTrack.d.ts","sourceRoot":"","sources":["../../../../../src/features/queue/activeTrack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAInE;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4FAA4F;IAC5F,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,8DAA8D;IAC9D,YAAY,EAAE,MAAM,CAAA;IACpB,uFAAuF;IACvF,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iFAAiF;IACjF,KAAK,CAAC,EAAE,KAAK,CAAA;CACd;AAID;;GAEG;AACH,wBAAgB,cAAc,IAAI,KAAK,GAAG,SAAS,CAElD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,GAAG,SAAS,CAExD;AAID;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,qDAG9B,CAAA;AAOH;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,KAAK,GAAG,SAAS,CAElD"}
|
|
@@ -14,6 +14,8 @@ export interface PlaybackQueueEndedEvent {
|
|
|
14
14
|
* @param tracks - The tracks to add to the queue.
|
|
15
15
|
* @param insertBeforeIndex - (Optional) The index to insert the tracks before.
|
|
16
16
|
* By default the tracks will be added to the end of the queue.
|
|
17
|
+
* @throws If `insertBeforeIndex` is negative or past the queue's length.
|
|
18
|
+
* Android and the web treat `-1` as append; iOS throws on it.
|
|
17
19
|
*/
|
|
18
20
|
export declare function add(tracks: Track[], insertBeforeIndex?: number): void;
|
|
19
21
|
/**
|
|
@@ -21,69 +23,94 @@ export declare function add(tracks: Track[], insertBeforeIndex?: number): void;
|
|
|
21
23
|
* @param track - The track to add to the queue.
|
|
22
24
|
* @param insertBeforeIndex - (Optional) The index to insert the track before.
|
|
23
25
|
* By default the track will be added to the end of the queue.
|
|
26
|
+
* @throws If `insertBeforeIndex` is negative or past the queue's length.
|
|
27
|
+
* Android and the web treat `-1` as append; iOS throws on it.
|
|
24
28
|
*/
|
|
25
29
|
export declare function add(track: Track, insertBeforeIndex?: number): void;
|
|
26
30
|
/**
|
|
27
31
|
* Replaces the current track or loads the track as the first in the queue.
|
|
28
32
|
* @param track - The track to load.
|
|
33
|
+
* @throws If called before `setupPlayer`.
|
|
29
34
|
*/
|
|
30
35
|
export declare function load(track: Track): void;
|
|
31
36
|
/**
|
|
32
37
|
* Move a track within the queue.
|
|
33
38
|
* @param fromIndex - The index of the track to be moved.
|
|
34
|
-
* @param toIndex - The index to move the track to.
|
|
35
|
-
*
|
|
39
|
+
* @param toIndex - The index to move the track to. On iOS and Android an index
|
|
40
|
+
* past the end moves the track to the end of the queue; the web throws.
|
|
41
|
+
* @throws If `fromIndex` is outside the queue or `toIndex` is negative (on the
|
|
42
|
+
* web, also if `toIndex` is past the last index).
|
|
36
43
|
*/
|
|
37
44
|
export declare function move(fromIndex: number, toIndex: number): void;
|
|
38
45
|
/**
|
|
39
46
|
* Removes multiple tracks from the queue by their indexes.
|
|
40
47
|
*
|
|
41
|
-
* If the
|
|
42
|
-
*
|
|
43
|
-
*
|
|
48
|
+
* If the active track is removed, the track after it becomes active. On iOS
|
|
49
|
+
* and the web that is the next index, wrapping to the first track. On Android
|
|
50
|
+
* it is the next track in playback order (shuffle and repeat apply), and
|
|
51
|
+
* removing the last track with repeat `off` makes the first track active but
|
|
52
|
+
* ends playback.
|
|
44
53
|
*
|
|
45
54
|
* @param indexes - The indexes of the tracks to be removed.
|
|
55
|
+
* @throws If an index is outside the queue. Android checks every index before
|
|
56
|
+
* removing any, and also throws if an index appears twice. iOS removes from the
|
|
57
|
+
* highest index down, so an invalid index can throw after some tracks are gone,
|
|
58
|
+
* and a repeated index also removes the track that moved into its place. The
|
|
59
|
+
* web skips invalid and repeated indexes without throwing.
|
|
46
60
|
*/
|
|
47
61
|
export declare function remove(indexes: number[]): void;
|
|
48
62
|
/**
|
|
49
63
|
* Removes a track from the queue by its index.
|
|
50
64
|
*
|
|
51
|
-
* If the
|
|
52
|
-
*
|
|
53
|
-
*
|
|
65
|
+
* If the active track is removed, the track after it becomes active. On iOS
|
|
66
|
+
* and the web that is the next index, wrapping to the first track. On Android
|
|
67
|
+
* it is the next track in playback order (shuffle and repeat apply), and
|
|
68
|
+
* removing the last track with repeat `off` makes the first track active but
|
|
69
|
+
* ends playback.
|
|
54
70
|
*
|
|
55
71
|
* @param index - The index of the track to be removed.
|
|
72
|
+
* @throws If `index` is outside the queue, on iOS and Android; the web
|
|
73
|
+
* ignores it.
|
|
56
74
|
*/
|
|
57
75
|
export declare function remove(index: number): void;
|
|
58
76
|
/**
|
|
59
|
-
*
|
|
77
|
+
* Removes every track after the active track's index in the queue. With
|
|
78
|
+
* shuffle on, this is queue order, not the shuffled play order.
|
|
60
79
|
*/
|
|
61
80
|
export declare function removeUpcomingTracks(): void;
|
|
62
81
|
/**
|
|
63
82
|
* Skips to a track in the queue.
|
|
64
83
|
* @param index - The index of the track to skip to.
|
|
65
84
|
* @param initialPosition - (Optional) The initial position to seek to in seconds.
|
|
85
|
+
* @throws If `index` is outside the queue.
|
|
66
86
|
*/
|
|
67
87
|
export declare function skip(index: number, initialPosition?: number): void;
|
|
68
88
|
/**
|
|
69
89
|
* Skips to the next track in the queue.
|
|
70
|
-
* @param initialPosition - (Optional) The
|
|
90
|
+
* @param initialPosition - (Optional) The position in seconds to start the next
|
|
91
|
+
* track from. On iOS and Android, with no next track the active track seeks to
|
|
92
|
+
* it instead; on the web the call does nothing.
|
|
71
93
|
*/
|
|
72
94
|
export declare function skipToNext(initialPosition?: number): void;
|
|
73
95
|
/**
|
|
74
96
|
* Skips to the previous track in the queue.
|
|
75
|
-
* @param initialPosition - (Optional) The
|
|
97
|
+
* @param initialPosition - (Optional) The position in seconds to start the
|
|
98
|
+
* previous track from. On iOS and Android, with no previous track the active
|
|
99
|
+
* track seeks to it instead; on the web the call does nothing.
|
|
76
100
|
*/
|
|
77
101
|
export declare function skipToPrevious(initialPosition?: number): void;
|
|
78
102
|
/**
|
|
79
103
|
* Sets (replaces) the queue.
|
|
80
104
|
*
|
|
81
|
-
*
|
|
82
|
-
* playing and stays paused if it was paused.
|
|
83
|
-
* start playback.
|
|
105
|
+
* On iOS and Android this does not change the play/pause state: the player
|
|
106
|
+
* keeps playing if it was playing and stays paused if it was paused. On the
|
|
107
|
+
* web it stops playback. Call `play` after it to start playback.
|
|
84
108
|
*
|
|
85
109
|
* @param tracks - The tracks to set as the queue.
|
|
86
110
|
* @param startIndex - (Optional) The index of the track to make active.
|
|
111
|
+
* Defaults to 0 on iOS and Android; on the web, omitting it leaves no track
|
|
112
|
+
* active. iOS clamps an out-of-range index into the queue, Android throws, and
|
|
113
|
+
* the web ignores it.
|
|
87
114
|
* @param startPosition - (Optional) The position in seconds to start the active track from.
|
|
88
115
|
*/
|
|
89
116
|
export declare function setQueue(tracks: Track[], startIndex?: number, startPosition?: number): void;
|
|
@@ -98,17 +125,18 @@ export declare function getTrack(index: number): Track | undefined;
|
|
|
98
125
|
*/
|
|
99
126
|
export declare function getQueue(): Track[];
|
|
100
127
|
/**
|
|
101
|
-
* Subscribes to playback queue ended events
|
|
102
|
-
*
|
|
128
|
+
* Subscribes to playback queue ended events: fires when the last track in
|
|
129
|
+
* playback order finishes with repeat mode `off` and the playback state
|
|
130
|
+
* becomes `ended`. Never fires under `track` or `queue` repeat.
|
|
103
131
|
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
104
132
|
*/
|
|
105
133
|
export declare const onQueueEnded: NativeUpdatedValue<PlaybackQueueEndedEvent>;
|
|
106
134
|
/**
|
|
107
135
|
* Subscribes to queue change events.
|
|
108
|
-
* Called when tracks are added, removed, or reordered.
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
136
|
+
* Called when tracks are added, removed, or reordered. On iOS and Android a
|
|
137
|
+
* favorite toggle also fires it, alongside `onFavoriteChanged`. On web a
|
|
138
|
+
* favorite toggle fires only `onFavoriteChanged`. {@link useQueue} subscribes
|
|
139
|
+
* to both.
|
|
112
140
|
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
113
141
|
*/
|
|
114
142
|
export declare const onQueueChanged: NativeUpdatedValue<Track[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../../../src/features/queue/queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAMnE;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAA;IACb,0FAA0F;IAC1F,QAAQ,EAAE,MAAM,CAAA;CACjB;AAID
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../../../src/features/queue/queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAMnE;;GAE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B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAEzD;AAED;;GAEG;AACH,wBAAgB,QAAQ,IAAI,KAAK,EAAE,CAElC;AAID;;;;;GAKG;AACH,eAAO,MAAM,YAAY,6CAGtB,CAAA;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,6BAE1B,CAAA;AAOD;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,KAAK,EAAE,CAElC"}
|
|
@@ -16,13 +16,13 @@ export declare function getRepeatMode(): RepeatMode;
|
|
|
16
16
|
* @param repeatMode - The repeat mode to set
|
|
17
17
|
*/
|
|
18
18
|
export declare function setRepeatMode(repeatMode: RepeatMode): void;
|
|
19
|
+
/** Event data for when the repeat mode changes. */
|
|
19
20
|
export interface RepeatModeChangedEvent {
|
|
20
21
|
/** The new repeat mode */
|
|
21
22
|
repeatMode: RepeatMode;
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
24
25
|
* Subscribes to repeat mode changes.
|
|
25
|
-
* @param callback - Called when repeat mode changes
|
|
26
26
|
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
27
27
|
*/
|
|
28
28
|
export declare const onRepeatModeChanged: NativeUpdatedValue<RepeatModeChangedEvent>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repeatMode.d.ts","sourceRoot":"","sources":["../../../../../src/features/queue/repeatMode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAKnE;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,CAAA;AAIlD;;GAEG;AACH,wBAAgB,aAAa,IAAI,UAAU,CAE1C;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,UAAU,QAEnD;AAID,MAAM,WAAW,sBAAsB;IACrC,0BAA0B;IAC1B,UAAU,EAAE,UAAU,CAAA;CACvB;AAED
|
|
1
|
+
{"version":3,"file":"repeatMode.d.ts","sourceRoot":"","sources":["../../../../../src/features/queue/repeatMode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAKnE;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,CAAA;AAIlD;;GAEG;AACH,wBAAgB,aAAa,IAAI,UAAU,CAE1C;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,UAAU,QAEnD;AAID,mDAAmD;AACnD,MAAM,WAAW,sBAAsB;IACrC,0BAA0B;IAC1B,UAAU,EAAE,UAAU,CAAA;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,4CAG7B,CAAA;AAIH;;;GAGG;AACH,wBAAgB,aAAa,IAAI,UAAU,CAE1C"}
|
|
@@ -15,7 +15,6 @@ export declare function setShuffle(enabled: boolean): void;
|
|
|
15
15
|
export declare function toggleShuffle(): void;
|
|
16
16
|
/**
|
|
17
17
|
* Subscribes to shuffle mode changes.
|
|
18
|
-
* @param callback - Called when shuffle mode changes
|
|
19
18
|
* @returns An emitter — subscribe with `addListener(callback)`, which returns a cleanup function
|
|
20
19
|
*/
|
|
21
20
|
export declare const onShuffleChanged: NativeUpdatedValue<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shuffle.d.ts","sourceRoot":"","sources":["../../../../../src/features/queue/shuffle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAKnE;;GAEG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAEjD;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAEpC;AAID
|
|
1
|
+
{"version":3,"file":"shuffle.d.ts","sourceRoot":"","sources":["../../../../../src/features/queue/shuffle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAKnE;;GAEG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAEjD;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAEpC;AAID;;;GAGG;AACH,eAAO,MAAM,gBAAgB,6BAE5B,CAAA;AAID;;;GAGG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAEpC"}
|