react-native-audio-browser 0.2.0-next.82 → 0.2.0-next.84
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/android/src/main/java/com/audiobrowser/player/InterceptingPlayer.kt +31 -9
- package/android/src/main/java/com/audiobrowser/player/MediaFactory.kt +39 -46
- package/android/src/main/java/com/audiobrowser/player/Player.kt +219 -54
- package/android/src/main/java/com/audiobrowser/player/PlayerEngineFactory.kt +5 -6
- package/android/src/main/java/com/audiobrowser/player/PlayerListener.kt +88 -73
- package/android/src/main/java/com/audiobrowser/player/ReconnectPacer.kt +8 -9
- package/android/src/main/java/com/audiobrowser/player/RetryFocus.kt +126 -0
- package/android/src/main/java/com/audiobrowser/player/RetryLoadErrorHandlingPolicy.kt +55 -121
- package/android/src/main/java/com/audiobrowser/player/RetryLocks.kt +52 -0
- package/android/src/main/java/com/audiobrowser/player/RetryLoop.kt +310 -0
- package/android/src/main/java/com/audiobrowser/player/RetryView.kt +31 -0
- package/android/src/main/java/com/audiobrowser/player/SessionViewListener.kt +148 -0
- package/android/src/main/java/com/audiobrowser/remote/RemoteOutputsController.kt +4 -1
- package/android/src/main/java/com/audiobrowser/remote/RemoteSwitchingPlayer.kt +3 -1
- package/android/src/main/java/com/audiobrowser/util/NetworkConnectivityMonitor.kt +4 -6
- package/android/src/test/java/androidx/media3/session/SessionViews.kt +9 -0
- package/android/src/test/java/com/audiobrowser/NetworkFixtures.kt +25 -0
- package/android/src/test/java/com/audiobrowser/player/LiveStreamEndTest.kt +15 -53
- package/android/src/test/java/com/audiobrowser/player/PlayerRetryTest.kt +190 -53
- package/android/src/test/java/com/audiobrowser/player/RetryFocusTest.kt +97 -0
- package/android/src/test/java/com/audiobrowser/player/RetryLoadErrorHandlingPolicyTest.kt +90 -152
- package/android/src/test/java/com/audiobrowser/player/RetryLocksTest.kt +48 -0
- package/android/src/test/java/com/audiobrowser/player/RetryLoopCaseTest.kt +181 -0
- package/android/src/test/java/com/audiobrowser/player/RetryLoopTest.kt +221 -0
- package/android/src/test/java/com/audiobrowser/player/RetryMaskingTest.kt +176 -0
- package/android/src/test/java/com/audiobrowser/player/SessionPlayTest.kt +2 -0
- package/android/src/test/java/com/audiobrowser/player/SessionViewListenerTest.kt +21 -0
- package/android/src/test/java/com/audiobrowser/player/SessionViewTest.kt +2 -0
- package/android/src/test/java/com/audiobrowser/util/NetworkConnectivityMonitorTest.kt +13 -4
- package/ios/Player/ErrorStatus.swift +4 -0
- package/ios/Player/Player.swift +23 -9
- package/ios/Player/RetryLoop.swift +13 -9
- package/ios/Tests/PlayerPolicyTests.swift +114 -5
- package/ios/Tests/PlayerTests.swift +32 -0
- package/ios/Tests/RetryLoopTests.swift +8 -5
- package/lib/commonjs/features/player/setup.js +5 -4
- package/lib/commonjs/features/player/setup.js.map +1 -1
- package/lib/module/features/player/setup.js +5 -4
- package/lib/module/features/player/setup.js.map +1 -1
- package/lib/typescript/src/features/player/setup.d.ts +19 -13
- package/lib/typescript/src/features/player/setup.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/features/player/setup.ts +19 -13
- package/website/guide/errors.md +42 -38
- package/website/guide/network.md +4 -3
- package/android/src/main/java/com/audiobrowser/player/StuckRecoveryPolicy.kt +0 -37
- package/android/src/test/java/com/audiobrowser/player/StuckRecoveryPolicyTest.kt +0 -40
|
@@ -62,6 +62,23 @@ private func makeVirtual(online: Bool = true) throws -> (Player, MockPlayerEngin
|
|
|
62
62
|
return (player, engine, callbacks, clock)
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
/// A live stream connecting, its retry loop on a virtual clock; the engine reports `previousBuffered`
|
|
66
|
+
/// from the item the connect replaces until the test prepares one.
|
|
67
|
+
@MainActor
|
|
68
|
+
private func makeConnecting(
|
|
69
|
+
playWhenReady: Bool = true,
|
|
70
|
+
previousBuffered: Double = 0,
|
|
71
|
+
) throws -> (Player, MockPlayerEngine, VirtualClock) {
|
|
72
|
+
let clock = VirtualClock()
|
|
73
|
+
let retry = RetryLoop(clock: clock)
|
|
74
|
+
retry.updatePolicy(from: .first(true))
|
|
75
|
+
let engine = MockPlayerEngine()
|
|
76
|
+
engine.bufferedPosition = previousBuffered
|
|
77
|
+
let player = makePlayer(engine: engine, retry: retry)
|
|
78
|
+
try player.setQueue([Track(id: "t1", src: "https://example.com/a.mp3", title: "T", live: true)], playWhenReady: playWhenReady)
|
|
79
|
+
return (player, engine, clock)
|
|
80
|
+
}
|
|
81
|
+
|
|
65
82
|
@Suite("Player - seeking")
|
|
66
83
|
@MainActor
|
|
67
84
|
struct PlayerSeekingTests {
|
|
@@ -476,8 +493,91 @@ struct PlayerRecoveringTests {
|
|
|
476
493
|
|
|
477
494
|
@Test func aTrackChangeEndsTheStallWatch() throws {
|
|
478
495
|
let (player, _, _) = try makeStalling()
|
|
496
|
+
let stallWatch = player.retry.stallTask
|
|
479
497
|
try player.setQueue([Track(id: "t2", src: "https://example.com/b.mp3", title: "B")])
|
|
480
|
-
#expect(
|
|
498
|
+
#expect(stallWatch?.isCancelled == true)
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
@Test func aConnectThatSendsNothingIsReplacedAfterTheTimeout() async throws {
|
|
502
|
+
let (player, engine, clock) = try makeConnecting()
|
|
503
|
+
await clock.run(until: 30_999)
|
|
504
|
+
#expect(engine.resolveAndLoadCalls.count == 1)
|
|
505
|
+
await clock.run(until: 31_000)
|
|
506
|
+
#expect(engine.resolveAndLoadCalls.count == 2)
|
|
507
|
+
#expect(player.state == .loading)
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/// The item it replaces had buffered further than the new one has yet.
|
|
511
|
+
@Test func aSlowConnectThatKeepsReceivingDataIsKept() async throws {
|
|
512
|
+
let (player, engine, clock) = try makeConnecting(previousBuffered: 50)
|
|
513
|
+
engine.hasItem = true
|
|
514
|
+
engine.bufferedPosition = 1
|
|
515
|
+
engine.emit(.itemPrepared(likelyToKeepUp: false))
|
|
516
|
+
for atMs in stride(from: 20_000, through: 100_000, by: 20_000) {
|
|
517
|
+
clock.at(atMs) { engine.bufferedPosition += 1 }
|
|
518
|
+
}
|
|
519
|
+
await clock.run(until: 100_000)
|
|
520
|
+
#expect(player.state == .loading)
|
|
521
|
+
#expect(engine.resolveAndLoadCalls.count == 1)
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/// A stall's reconnect: the stalled item stays in the engine, still buffering, while the new
|
|
525
|
+
/// connect sends nothing.
|
|
526
|
+
@Test func theItemAConnectReplacesBufferingOnIsNoProgress() async throws {
|
|
527
|
+
let (player, engine, _, clock) = try makeVirtual()
|
|
528
|
+
engine.bufferedPosition = 50
|
|
529
|
+
player.transition(.avPlayerPlaying)
|
|
530
|
+
await clock.run(until: 10_000)
|
|
531
|
+
player.transition(.avPlayerWaiting)
|
|
532
|
+
await clock.run(until: 40_000)
|
|
533
|
+
#expect(engine.resolveAndLoadCalls.count == 2)
|
|
534
|
+
|
|
535
|
+
for atMs in stride(from: 45_000, through: 70_000, by: 5_000) {
|
|
536
|
+
clock.at(atMs) { engine.bufferedPosition += 1 }
|
|
537
|
+
}
|
|
538
|
+
await clock.run(until: 70_000)
|
|
539
|
+
await clock.run(until: 71_000)
|
|
540
|
+
#expect(engine.resolveAndLoadCalls.count == 3)
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
@Test func aPauseDuringAConnectHoldsItPastTheTimeout() async throws {
|
|
544
|
+
let (player, engine, clock) = try makeConnecting()
|
|
545
|
+
await clock.run(until: 10_000)
|
|
546
|
+
player.pause()
|
|
547
|
+
await clock.run(until: 200_000)
|
|
548
|
+
#expect(engine.resolveAndLoadCalls.count == 1)
|
|
549
|
+
#expect(player.load?.reloadOnPlay == false)
|
|
550
|
+
#expect(player.state == .loading)
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
@Test func withRetryOffASilentConnectIsTerminalAtTheTimeout() async throws {
|
|
554
|
+
let (player, engine, clock) = try makeConnecting()
|
|
555
|
+
player.retry.updatePolicy(from: nil)
|
|
556
|
+
await clock.run(until: 29_999)
|
|
557
|
+
#expect(player.state == .loading)
|
|
558
|
+
await clock.run(until: 30_000)
|
|
559
|
+
#expect(player.state == .error)
|
|
560
|
+
#expect(player.errorStatus.error == .playbackStalled)
|
|
561
|
+
#expect(engine.resolveAndLoadCalls.count == 1)
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
@Test func aPlayWhileConnectingWatchesTheConnect() async throws {
|
|
565
|
+
let (player, engine, clock) = try makeConnecting(playWhenReady: false)
|
|
566
|
+
await clock.run(until: 10_000)
|
|
567
|
+
player.play()
|
|
568
|
+
await clock.run(until: 41_000)
|
|
569
|
+
#expect(engine.resolveAndLoadCalls.count == 2)
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
/// Ready and waiting for AVPlayer to start: its waiting is a stall, watched in .buffering.
|
|
573
|
+
@Test func aConnectThatIsReadyIsNoLongerWatched() async throws {
|
|
574
|
+
let (player, engine, clock) = try makeConnecting()
|
|
575
|
+
engine.hasItem = true
|
|
576
|
+
engine.hasLoadedAsset = true
|
|
577
|
+
engine.emit(.itemPrepared(likelyToKeepUp: true))
|
|
578
|
+
#expect(player.state == .ready)
|
|
579
|
+
await clock.run(until: 100_000)
|
|
580
|
+
#expect(engine.resolveAndLoadCalls.count == 1)
|
|
481
581
|
}
|
|
482
582
|
|
|
483
583
|
/// A link slower than the bitrate rebuffers for longer than the timeout, and a reload would
|
|
@@ -550,11 +650,15 @@ struct PlayerRecoveringTests {
|
|
|
550
650
|
let callbacks = MockPlayerCallbacks()
|
|
551
651
|
player.callbacks = callbacks
|
|
552
652
|
try player.setQueue([Track(id: "t1", src: "https://example.com/a.mp3", title: "T")], playWhenReady: true)
|
|
653
|
+
// The watch replaces the silent connect at 30 s, 1 s after it gives up on it; that failure
|
|
654
|
+
// brings the deadline to 42 s.
|
|
655
|
+
await clock.run(until: 31_000)
|
|
656
|
+
#expect(engine.resolveAndLoadCalls.count == 2)
|
|
553
657
|
let cancels = engine.cancelLoadingCount, stops = engine.stopObservingItemCount
|
|
554
658
|
|
|
555
|
-
await clock.run(until:
|
|
659
|
+
await clock.run(until: 41_999)
|
|
556
660
|
#expect(player.state == .loading)
|
|
557
|
-
await clock.run(until:
|
|
661
|
+
await clock.run(until: 42_000)
|
|
558
662
|
|
|
559
663
|
#expect(player.state == .error)
|
|
560
664
|
#expect(player.errorStatus.error == .playbackStalled)
|
|
@@ -598,14 +702,17 @@ struct PlayerRecoveringTests {
|
|
|
598
702
|
#expect(engine.resolveAndLoadCalls.count == 2)
|
|
599
703
|
}
|
|
600
704
|
|
|
705
|
+
/// The watch replaces the stall at 40 s at once, having played, then each silent connect 30 s
|
|
706
|
+
/// after it starts, 1 s and then 1.5 s later: the deadline still falls 120 s into the silence.
|
|
601
707
|
@Test func playbackThatStopsWithNoFailureEndsAtTheDeadline() async throws {
|
|
602
|
-
let (player,
|
|
708
|
+
let (player, engine, callbacks, clock) = try makeVirtual()
|
|
603
709
|
player.transition(.avPlayerPlaying)
|
|
604
710
|
await clock.run(until: 10_000)
|
|
605
711
|
player.transition(.avPlayerWaiting)
|
|
606
712
|
|
|
607
713
|
await clock.run(until: 129_999)
|
|
608
|
-
#expect(player.state == .
|
|
714
|
+
#expect(player.state == .loading)
|
|
715
|
+
#expect(engine.resolveAndLoadCalls.count == 4)
|
|
609
716
|
await clock.run(until: 130_000)
|
|
610
717
|
#expect(player.state == .error)
|
|
611
718
|
#expect(player.errorStatus.error == .playbackStalled)
|
|
@@ -614,6 +721,8 @@ struct PlayerRecoveringTests {
|
|
|
614
721
|
|
|
615
722
|
@Test func aRetryNowKeepsTheSilenceDeadline() async throws {
|
|
616
723
|
let (player, _, _, clock) = try makeVirtual()
|
|
724
|
+
// Its watch would end the reload's connect first.
|
|
725
|
+
player.retry.stallTimeout = .seconds(600)
|
|
617
726
|
await clock.run(until: 60_000)
|
|
618
727
|
player.retryNow()
|
|
619
728
|
|
|
@@ -1402,6 +1402,22 @@ struct StopCancelsRetryTests {
|
|
|
1402
1402
|
#expect(player.state == .stopped)
|
|
1403
1403
|
#expect(callbacks.errorEvents.isEmpty)
|
|
1404
1404
|
}
|
|
1405
|
+
|
|
1406
|
+
/// Guards where stop() cancels the retry, not the order of its render: lowering the intent with
|
|
1407
|
+
/// a retry pending would park it for a reload on play, and a stop is no pause.
|
|
1408
|
+
@Test @MainActor
|
|
1409
|
+
func stop_duringARetry_goesStraightToStopped() throws {
|
|
1410
|
+
let (c, eh, cb, _) = makeCoordinator()
|
|
1411
|
+
try startPlaying(c, eh)
|
|
1412
|
+
eh.emit(.failed(URLError(.timedOut), httpStatusCode: nil))
|
|
1413
|
+
#expect(c.retry.pendingTask != nil)
|
|
1414
|
+
cb.playbackChanges.removeAll()
|
|
1415
|
+
|
|
1416
|
+
c.stop()
|
|
1417
|
+
|
|
1418
|
+
#expect(cb.playbackChanges.map(\.state) == [.stopped])
|
|
1419
|
+
#expect(c.load?.reloadOnPlay == false)
|
|
1420
|
+
}
|
|
1405
1421
|
}
|
|
1406
1422
|
|
|
1407
1423
|
// MARK: - Audio session release (#60)
|
|
@@ -1563,6 +1579,22 @@ struct MediaStackEffectTests {
|
|
|
1563
1579
|
#expect(try cleared < #require(cb.publishOrder.firstIndex(of: "renderNowPlaying")))
|
|
1564
1580
|
}
|
|
1565
1581
|
|
|
1582
|
+
@Test @MainActor
|
|
1583
|
+
func stop_rendersTheStoppedStateWithThePlayIntentDown() throws {
|
|
1584
|
+
let (c, eh, _, _) = makeCoordinator()
|
|
1585
|
+
try startPlaying(c, eh)
|
|
1586
|
+
var renders: [(PlaybackState, Bool)] = []
|
|
1587
|
+
eh.onSeamCall = { [unowned c] in
|
|
1588
|
+
if $0 == "renderNowPlaying" { renders.append((c.state, c.playWhenReady)) }
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
c.stop()
|
|
1592
|
+
|
|
1593
|
+
let stopped = renders.filter { $0.0 == .stopped }
|
|
1594
|
+
#expect(!stopped.isEmpty)
|
|
1595
|
+
#expect(stopped.allSatisfy { !$0.1 })
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1566
1598
|
@Test @MainActor
|
|
1567
1599
|
func pause_keepsTheStreamTitle() throws {
|
|
1568
1600
|
let (c, eh, cb) = makeTraced()
|
|
@@ -116,13 +116,15 @@ struct RetryLoopCaseTests {
|
|
|
116
116
|
#expect(rig.connects.allSatisfy { $0 < endedAt })
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
/// The watch gives the silent connect up at 30 s, a failure that starts the first-connect
|
|
120
|
+
/// budget; having delivered nothing, it is replaced 1 s later.
|
|
121
|
+
@Test func aConnectionOpenWithNoDataIsReplacedAt30s_andEndsAt42s() async {
|
|
120
122
|
let rig = Rig()
|
|
121
123
|
rig.play { _ in }
|
|
122
124
|
await rig.run(untilMs: 300_000)
|
|
123
|
-
#expect(rig.
|
|
125
|
+
#expect(rig.connects == [0, 31_000])
|
|
126
|
+
#expect(rig.errors.map(\.atMs) == [42_000])
|
|
124
127
|
#expect(rig.errors.map(\.error) == [.playbackStalled])
|
|
125
|
-
#expect(rig.connects == [0])
|
|
126
128
|
}
|
|
127
129
|
|
|
128
130
|
@Test func aDeadAddressThatNeverPlayedEnds12sAfterItsFirstFailure() async {
|
|
@@ -204,7 +206,8 @@ struct RetryLoopCaseTests {
|
|
|
204
206
|
@Test func aPauseClearsTheDeadline() async {
|
|
205
207
|
let rig = Rig()
|
|
206
208
|
rig.play { _ in }
|
|
207
|
-
|
|
209
|
+
// Before the watch gives the connect up at 30 s.
|
|
210
|
+
rig.clock.at(20_000) { rig.loop.playIntentChanged(false) }
|
|
208
211
|
await rig.run(untilMs: 300_000)
|
|
209
212
|
#expect(rig.errors.isEmpty)
|
|
210
213
|
}
|
|
@@ -212,7 +215,7 @@ struct RetryLoopCaseTests {
|
|
|
212
215
|
@Test func aCancelClearsTheDeadline_untilTheNextConnect() async {
|
|
213
216
|
let rig = Rig()
|
|
214
217
|
rig.play { _ in }
|
|
215
|
-
rig.clock.at(
|
|
218
|
+
rig.clock.at(20_000) { rig.loop.cancel() }
|
|
216
219
|
await rig.run(untilMs: 300_000)
|
|
217
220
|
#expect(rig.errors.isEmpty)
|
|
218
221
|
}
|
|
@@ -188,10 +188,11 @@ var _validateOptions = require("./validateOptions");
|
|
|
188
188
|
* `firstConnectMaxRetryDurationMs`. A stream that fails before ever playing
|
|
189
189
|
* is usually dead, and the listener is actively waiting for a verdict —
|
|
190
190
|
* seconds, not minutes.
|
|
191
|
-
* - **Recovery
|
|
192
|
-
* `maxRetryDurationMs
|
|
193
|
-
* transient (tunnels, network
|
|
194
|
-
* and patience is what recovers
|
|
191
|
+
* - **Recovery**: the player gives up once it has been silent for
|
|
192
|
+
* `maxRetryDurationMs`; only 5 s of audio in a row ends a silence. Playback
|
|
193
|
+
* proved the stream works; drops are usually transient (tunnels, network
|
|
194
|
+
* handovers, a station's encoder restarting) and patience is what recovers
|
|
195
|
+
* them unattended.
|
|
195
196
|
*
|
|
196
197
|
* While the device is offline, the first-connect budget does not apply: the
|
|
197
198
|
* player waits for connectivity to return (bounded by `maxRetryDurationMs`),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_native","require","_validateOptions","resolveNowPlaying","value","autoUpdateNowPlayingMetadata","nowPlayingMetadataFormatter","wrapNowPlayingFormatter","undefined","formatter","params","definedFields","obj","out","key","nonEmpty","Object","keys","length","setupPlayer","options","nowPlaying","capabilities","forwardJumpInterval","backwardJumpInterval","progressUpdateEventInterval","android","ios","nativeSetup","appKilledPlaybackBehavior","skipSilence","remoteButtonLayout","androidSetup","playbackRates","carPlayUpNextButton","carPlayNowPlayingButtons","carPlayPlayingIndicatorLocation","iosSetup","iosUpdate","validateIOSUpdateOptions","updates","nativeBrowser"],"sourceRoot":"../../../../src","sources":["features/player/setup.ts"],"mappings":";;;;;;AAYA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AAbA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA0BA;AACA;AACA;AACA;AACA;;AAGA;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;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;AASA;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;;AAYA;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;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["_native","require","_validateOptions","resolveNowPlaying","value","autoUpdateNowPlayingMetadata","nowPlayingMetadataFormatter","wrapNowPlayingFormatter","undefined","formatter","params","definedFields","obj","out","key","nonEmpty","Object","keys","length","setupPlayer","options","nowPlaying","capabilities","forwardJumpInterval","backwardJumpInterval","progressUpdateEventInterval","android","ios","nativeSetup","appKilledPlaybackBehavior","skipSilence","remoteButtonLayout","androidSetup","playbackRates","carPlayUpNextButton","carPlayNowPlayingButtons","carPlayPlayingIndicatorLocation","iosSetup","iosUpdate","validateIOSUpdateOptions","updates","nativeBrowser"],"sourceRoot":"../../../../src","sources":["features/player/setup.ts"],"mappings":";;;;;;AAYA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AAbA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA0BA;AACA;AACA;AACA;AACA;;AAGA;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;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;AASA;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;;AAYA;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;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA+BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAyGA;;AAqDA;;AA2BA;AACA;AACA;AACA;AACA;;AAoCA;;AAEA;AACA;AACA;AACA;;AAMA;AACA;AACA;A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AAC,EACjB;EACf,MAAM;IACJC,UAAU;IACVC,YAAY;IACZC,mBAAmB;IACnBC,oBAAoB;IACpBC,2BAA2B;IAC3BC,OAAO,GAAG,CAAC,CAAC;IACZC,GAAG,GAAG,CAAC,CAAC;IACR,GAAGC;EACL,CAAC,GAAGR,OAAO;;EAEX;EACA;EACA;EACA,MAAM;IACJS,yBAAyB;IACzBC,WAAW;IACXC,kBAAkB;IAClB,GAAGC;EACL,CAAC,GAAGN,OAAO;EACX,MAAM;IACJO,aAAa;IACbC,mBAAmB;IACnBC,wBAAwB;IACxBC,+BAA+B;IAC/B,GAAGC;EACL,CAAC,GAAGV,GAAG;EACP,MAAMW,SAAS,GAAG3B,aAAa,CAAC;IAC9BsB,aAAa;IACbC,mBAAmB;IACnBC,wBAAwB;IACxBC;EACF,CAAC,CAAC;EACF,IAAAG,yCAAwB,EAACD,SAAS,CAAC;EAEnC,MAAME,OAA4B,GAAG7B,aAAa,CAAC;IACjDW,YAAY;IACZC,mBAAmB;IACnBC,oBAAoB;IACpBC,2BAA2B;IAC3B,GAAGV,QAAQ,CACT,SAAS,EACTJ,aAAa,CAAC;MACZkB,yBAAyB;MACzBC,WAAW;MACXC;IACF,CAAC,CACH,CAAC;IACD,GAAGhB,QAAQ,CAAC,KAAK,EAAEuB,SAAS;EAC9B,CAAC,CAAC;EAEF,OAAOG,qBAAa,CAACtB,WAAW,CAAC;IAC/B,GAAGS,WAAW;IACd,GAAGb,QAAQ,CAAC,SAAS,EAAEJ,aAAa,CAACqB,YAAY,CAAC,CAAC;IACnD,GAAGjB,QAAQ,CAAC,KAAK,EAAEJ,aAAa,CAAC0B,QAAQ,CAAC,CAAC;IAC3C,GAAGlC,iBAAiB,CAACkB,UAAU,CAAC;IAChC,GAAGN,QAAQ,CAAC,SAAS,EAAEyB,OAAO;EAChC,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -185,10 +185,11 @@ import { validateIOSUpdateOptions } from './validateOptions';
|
|
|
185
185
|
* `firstConnectMaxRetryDurationMs`. A stream that fails before ever playing
|
|
186
186
|
* is usually dead, and the listener is actively waiting for a verdict —
|
|
187
187
|
* seconds, not minutes.
|
|
188
|
-
* - **Recovery
|
|
189
|
-
* `maxRetryDurationMs
|
|
190
|
-
* transient (tunnels, network
|
|
191
|
-
* and patience is what recovers
|
|
188
|
+
* - **Recovery**: the player gives up once it has been silent for
|
|
189
|
+
* `maxRetryDurationMs`; only 5 s of audio in a row ends a silence. Playback
|
|
190
|
+
* proved the stream works; drops are usually transient (tunnels, network
|
|
191
|
+
* handovers, a station's encoder restarting) and patience is what recovers
|
|
192
|
+
* them unattended.
|
|
192
193
|
*
|
|
193
194
|
* While the device is offline, the first-connect budget does not apply: the
|
|
194
195
|
* player waits for connectivity to return (bounded by `maxRetryDurationMs`),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["nativeBrowser","validateIOSUpdateOptions","resolveNowPlaying","value","autoUpdateNowPlayingMetadata","nowPlayingMetadataFormatter","wrapNowPlayingFormatter","undefined","formatter","params","definedFields","obj","out","key","nonEmpty","Object","keys","length","setupPlayer","options","nowPlaying","capabilities","forwardJumpInterval","backwardJumpInterval","progressUpdateEventInterval","android","ios","nativeSetup","appKilledPlaybackBehavior","skipSilence","remoteButtonLayout","androidSetup","playbackRates","carPlayUpNextButton","carPlayNowPlayingButtons","carPlayPlayingIndicatorLocation","iosSetup","iosUpdate","updates"],"sourceRoot":"../../../../src","sources":["features/player/setup.ts"],"mappings":";;AAAA;;AAYA,SAASA,aAAa,QAAQ,cAAc;AAC5C,SAASC,wBAAwB,QAAQ,mBAAmB;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA0BA;AACA;AACA;AACA;AACA;;AAGA;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;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;AASA;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;;AAYA;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;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["nativeBrowser","validateIOSUpdateOptions","resolveNowPlaying","value","autoUpdateNowPlayingMetadata","nowPlayingMetadataFormatter","wrapNowPlayingFormatter","undefined","formatter","params","definedFields","obj","out","key","nonEmpty","Object","keys","length","setupPlayer","options","nowPlaying","capabilities","forwardJumpInterval","backwardJumpInterval","progressUpdateEventInterval","android","ios","nativeSetup","appKilledPlaybackBehavior","skipSilence","remoteButtonLayout","androidSetup","playbackRates","carPlayUpNextButton","carPlayNowPlayingButtons","carPlayPlayingIndicatorLocation","iosSetup","iosUpdate","updates"],"sourceRoot":"../../../../src","sources":["features/player/setup.ts"],"mappings":";;AAAA;;AAYA,SAASA,aAAa,QAAQ,cAAc;AAC5C,SAASC,wBAAwB,QAAQ,mBAAmB;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA0BA;AACA;AACA;AACA;AACA;;AAGA;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;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;AASA;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;;AAYA;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;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA+BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAyGA;;AAqDA;;AA2BA;AACA;AACA;AACA;AACA;;AAoCA;;AAEA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;;AA6FA;;AAMA;AACA,SAASC,iBAAiBA,CACxBC,KAAuC,EACjB;EACtB,IAAI,OAAOA,KAAK,KAAK,UAAU,EAAE;IAC/B,OAAO;MACLC,4BAA4B,EAAE,IAAI;MAClCC,2BAA2B,EAAEC,uBAAuB,CAACH,K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MAAM;IACJS,yBAAyB;IACzBC,WAAW;IACXC,kBAAkB;IAClB,GAAGC;EACL,CAAC,GAAGN,OAAO;EACX,MAAM;IACJO,aAAa;IACbC,mBAAmB;IACnBC,wBAAwB;IACxBC,+BAA+B;IAC/B,GAAGC;EACL,CAAC,GAAGV,GAAG;EACP,MAAMW,SAAS,GAAG3B,aAAa,CAAC;IAC9BsB,aAAa;IACbC,mBAAmB;IACnBC,wBAAwB;IACxBC;EACF,CAAC,CAAC;EACFlC,wBAAwB,CAACoC,SAAS,CAAC;EAEnC,MAAMC,OAA4B,GAAG5B,aAAa,CAAC;IACjDW,YAAY;IACZC,mBAAmB;IACnBC,oBAAoB;IACpBC,2BAA2B;IAC3B,GAAGV,QAAQ,CACT,SAAS,EACTJ,aAAa,CAAC;MACZkB,yBAAyB;MACzBC,WAAW;MACXC;IACF,CAAC,CACH,CAAC;IACD,GAAGhB,QAAQ,CAAC,KAAK,EAAEuB,SAAS;EAC9B,CAAC,CAAC;EAEF,OAAOrC,aAAa,CAACkB,WAAW,CAAC;IAC/B,GAAGS,WAAW;IACd,GAAGb,QAAQ,CAAC,SAAS,EAAEJ,aAAa,CAACqB,YAAY,CAAC,CAAC;IACnD,GAAGjB,QAAQ,CAAC,KAAK,EAAEJ,aAAa,CAAC0B,QAAQ,CAAC,CAAC;IAC3C,GAAGlC,iBAAiB,CAACkB,UAAU,CAAC;IAChC,GAAGN,QAAQ,CAAC,SAAS,EAAEwB,OAAO;EAChC,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -221,10 +221,11 @@ export interface AndroidAudioOffloadSettings {
|
|
|
221
221
|
* `firstConnectMaxRetryDurationMs`. A stream that fails before ever playing
|
|
222
222
|
* is usually dead, and the listener is actively waiting for a verdict —
|
|
223
223
|
* seconds, not minutes.
|
|
224
|
-
* - **Recovery
|
|
225
|
-
* `maxRetryDurationMs
|
|
226
|
-
* transient (tunnels, network
|
|
227
|
-
* and patience is what recovers
|
|
224
|
+
* - **Recovery**: the player gives up once it has been silent for
|
|
225
|
+
* `maxRetryDurationMs`; only 5 s of audio in a row ends a silence. Playback
|
|
226
|
+
* proved the stream works; drops are usually transient (tunnels, network
|
|
227
|
+
* handovers, a station's encoder restarting) and patience is what recovers
|
|
228
|
+
* them unattended.
|
|
228
229
|
*
|
|
229
230
|
* While the device is offline, the first-connect budget does not apply: the
|
|
230
231
|
* player waits for connectivity to return (bounded by `maxRetryDurationMs`),
|
|
@@ -236,22 +237,26 @@ export interface AndroidAudioOffloadSettings {
|
|
|
236
237
|
*/
|
|
237
238
|
export type RetryConfig = {
|
|
238
239
|
/**
|
|
239
|
-
*
|
|
240
|
-
*
|
|
240
|
+
* The connections in a row that may deliver no audio before the player gives
|
|
241
|
+
* up. One that delivered audio starts the count over, so a stream that played
|
|
242
|
+
* and dropped reconnects once more than this. On Android, a failure media3
|
|
243
|
+
* retries within its connection (an HLS segment, a file of known length) is
|
|
244
|
+
* not a connection, and only the duration budgets bound it. Omit for no
|
|
245
|
+
* limit.
|
|
241
246
|
*/
|
|
242
247
|
maxRetries?: number;
|
|
243
248
|
/**
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
249
|
+
* How long in milliseconds the player may stay silent, the listener wanting
|
|
250
|
+
* audio and hearing none, before it gives up. Time offline counts, so
|
|
251
|
+
* playback never resumes by surprise after a long time offline.
|
|
247
252
|
*
|
|
248
253
|
* @default 120000 (2 minutes)
|
|
249
254
|
*/
|
|
250
255
|
maxRetryDurationMs?: number;
|
|
251
256
|
/**
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
* error carries the real diagnosis (`unreachable`, `not-found`, …).
|
|
257
|
+
* How long in milliseconds a load that has never produced audio keeps
|
|
258
|
+
* retrying after its first failure while online. When it runs out, the
|
|
259
|
+
* terminal error carries the real diagnosis (`unreachable`, `not-found`, …).
|
|
255
260
|
*
|
|
256
261
|
* @default 12000 (12 seconds)
|
|
257
262
|
*/
|
|
@@ -472,7 +477,8 @@ export type SetupPlayerOptions = Pick<UpdateOptions, 'capabilities' | 'forwardJu
|
|
|
472
477
|
* - `false`/`undefined`: no library retry. Android keeps media3's default
|
|
473
478
|
* handling, which retries a failed load a few times before surfacing the
|
|
474
479
|
* error; iOS fails at once.
|
|
475
|
-
* - `{ maxRetries: n }`:
|
|
480
|
+
* - `{ maxRetries: n }`: give up when a connection delivers no audio after
|
|
481
|
+
* n such connections in a row
|
|
476
482
|
* - `RetryConfig`: custom attempt and duration budgets
|
|
477
483
|
*
|
|
478
484
|
* Backoff timing and budgets: see the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../../../src/features/player/setup.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,EACV,oBAAoB,EACpB,gBAAgB,EAEhB,aAAa,EACd,MAAM,WAAW,CAAA;AAIlB;;;;;;;;GAQG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,mCAAmC;IACnC,KAAK,EAAE,KAAK,CAAA;IACZ;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,kHAAkH;IAClH,aAAa,EAAE,OAAO,CAAA;IACtB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,SAAS,CAAA;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACrC,MAAM,EAAE,sBAAsB,KAC3B,gBAAgB,GAAG,SAAS,CAAA;AAEjC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,uBAAuB,GAC/B,OAAO,GACP,QAAQ,GACR,cAAc,GACd,OAAO,GACP,SAAS,CAAA;AAEb;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,WAAW,GACnB,UAAU,GACV,eAAe,GACf,YAAY,GACZ,SAAS,GACT,aAAa,GACb,QAAQ,CAAA;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,UAAU,GACV,aAAa,GACb,eAAe,GACf,aAAa,GACb,WAAW,GACX,gBAAgB,GAChB,WAAW,GACX,aAAa,CAAA;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,MAAM,kBAAkB,GAC1B,eAAe,GACf,YAAY,GACZ,sCAAsC,GACtC,gBAAgB,GAChB,oBAAoB,GACpB,cAAc,GACd,kBAAkB,CAAA;AAEtB;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,eAAe,GAAG,eAAe,CAAA;AAE7E;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAEhC;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAA;CACpC;AAED
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../../../src/features/player/setup.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAA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BAAsB,WAAW,CAC/B,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CA2Df"}
|
package/package.json
CHANGED
|
@@ -270,10 +270,11 @@ export interface AndroidAudioOffloadSettings {
|
|
|
270
270
|
* `firstConnectMaxRetryDurationMs`. A stream that fails before ever playing
|
|
271
271
|
* is usually dead, and the listener is actively waiting for a verdict —
|
|
272
272
|
* seconds, not minutes.
|
|
273
|
-
* - **Recovery
|
|
274
|
-
* `maxRetryDurationMs
|
|
275
|
-
* transient (tunnels, network
|
|
276
|
-
* and patience is what recovers
|
|
273
|
+
* - **Recovery**: the player gives up once it has been silent for
|
|
274
|
+
* `maxRetryDurationMs`; only 5 s of audio in a row ends a silence. Playback
|
|
275
|
+
* proved the stream works; drops are usually transient (tunnels, network
|
|
276
|
+
* handovers, a station's encoder restarting) and patience is what recovers
|
|
277
|
+
* them unattended.
|
|
277
278
|
*
|
|
278
279
|
* While the device is offline, the first-connect budget does not apply: the
|
|
279
280
|
* player waits for connectivity to return (bounded by `maxRetryDurationMs`),
|
|
@@ -285,24 +286,28 @@ export interface AndroidAudioOffloadSettings {
|
|
|
285
286
|
*/
|
|
286
287
|
export type RetryConfig = {
|
|
287
288
|
/**
|
|
288
|
-
*
|
|
289
|
-
*
|
|
289
|
+
* The connections in a row that may deliver no audio before the player gives
|
|
290
|
+
* up. One that delivered audio starts the count over, so a stream that played
|
|
291
|
+
* and dropped reconnects once more than this. On Android, a failure media3
|
|
292
|
+
* retries within its connection (an HLS segment, a file of known length) is
|
|
293
|
+
* not a connection, and only the duration budgets bound it. Omit for no
|
|
294
|
+
* limit.
|
|
290
295
|
*/
|
|
291
296
|
maxRetries?: number
|
|
292
297
|
|
|
293
298
|
/**
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
*
|
|
299
|
+
* How long in milliseconds the player may stay silent, the listener wanting
|
|
300
|
+
* audio and hearing none, before it gives up. Time offline counts, so
|
|
301
|
+
* playback never resumes by surprise after a long time offline.
|
|
297
302
|
*
|
|
298
303
|
* @default 120000 (2 minutes)
|
|
299
304
|
*/
|
|
300
305
|
maxRetryDurationMs?: number
|
|
301
306
|
|
|
302
307
|
/**
|
|
303
|
-
*
|
|
304
|
-
*
|
|
305
|
-
* error carries the real diagnosis (`unreachable`, `not-found`, …).
|
|
308
|
+
* How long in milliseconds a load that has never produced audio keeps
|
|
309
|
+
* retrying after its first failure while online. When it runs out, the
|
|
310
|
+
* terminal error carries the real diagnosis (`unreachable`, `not-found`, …).
|
|
306
311
|
*
|
|
307
312
|
* @default 12000 (12 seconds)
|
|
308
313
|
*/
|
|
@@ -609,7 +614,8 @@ export type SetupPlayerOptions = Pick<
|
|
|
609
614
|
* - `false`/`undefined`: no library retry. Android keeps media3's default
|
|
610
615
|
* handling, which retries a failed load a few times before surfacing the
|
|
611
616
|
* error; iOS fails at once.
|
|
612
|
-
* - `{ maxRetries: n }`:
|
|
617
|
+
* - `{ maxRetries: n }`: give up when a connection delivers no audio after
|
|
618
|
+
* n such connections in a row
|
|
613
619
|
* - `RetryConfig`: custom attempt and duration budgets
|
|
614
620
|
*
|
|
615
621
|
* Backoff timing and budgets: see the
|
package/website/guide/errors.md
CHANGED
|
@@ -171,50 +171,54 @@ created when a track becomes current (selection, queue advance, skip) _or is
|
|
|
171
171
|
restarted from a terminal error_ (`retry()`, or any play command while in
|
|
172
172
|
`'error'`), and it survives every automatic retry of that track.
|
|
173
173
|
|
|
174
|
-
A new load starts fresh budgets.
|
|
175
|
-
after a stretch of uninterrupted playback, and on Android after a recovery
|
|
176
|
-
(see below).
|
|
174
|
+
A new load starts fresh budgets.
|
|
177
175
|
|
|
178
176
|
How long the player keeps trying depends on one piece of evidence: **has this
|
|
179
177
|
load ever produced audio?**
|
|
180
178
|
|
|
181
|
-
| Situation | Budget
|
|
182
|
-
| --------------------------------------------- |
|
|
183
|
-
| **First connect** — the load has never played | `firstConnectMaxRetryDurationMs
|
|
184
|
-
| **Recovery** —
|
|
179
|
+
| Situation | Budget | Why |
|
|
180
|
+
| --------------------------------------------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
181
|
+
| **First connect** — the load has never played | `firstConnectMaxRetryDurationMs` after its first failure, default **12s** | A stream that fails before ever playing is usually dead, and the listener is actively waiting for a verdict — seconds, not minutes. |
|
|
182
|
+
| **Recovery** — any load | `maxRetryDurationMs` of silence, default **2 min** | Playback proved the stream works. Drops are usually transient (tunnels, network handovers, a station's encoder restarting) and patience recovers them unattended. |
|
|
185
183
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
restoration the load gets another full first-connect window, because the
|
|
192
|
-
clock only ever measures a contiguous online stretch.
|
|
193
|
-
|
|
194
|
-
`maxRetryDurationMs` is different: it is a wall-clock ceiling that
|
|
195
|
-
**includes** offline time. It exists so playback can't surprise the listener
|
|
196
|
-
by resuming after a long time offline.
|
|
197
|
-
|
|
198
|
-
`maxRetries` additionally caps the retry attempts, counted across both budgets
|
|
199
|
-
and across offline/online transitions.
|
|
184
|
+
**Silence** is time the listener wants audio and hears none. Only 5 s of audio
|
|
185
|
+
in a row ends it, so a stream that plays a moment between failures stays
|
|
186
|
+
silent, and a stream that closes every 10 s but plays in between keeps playing
|
|
187
|
+
however long it runs. The player gives up when the deadline passes, without
|
|
188
|
+
waiting for another failure.
|
|
200
189
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
190
|
+
While the device is **offline**, the first-connect budget does not apply: the
|
|
191
|
+
player makes no connection and connects the moment connectivity returns, so a
|
|
192
|
+
stream started in a tunnel still plays when the network comes back. Any offline
|
|
193
|
+
observation resets the first-connect clock, which only ever measures a
|
|
194
|
+
contiguous online stretch.
|
|
195
|
+
|
|
196
|
+
Time offline **counts** toward `maxRetryDurationMs`, so playback can't surprise
|
|
197
|
+
the listener by resuming after a long time offline.
|
|
198
|
+
|
|
199
|
+
After a connection that delivered audio, the player reconnects at once; after
|
|
200
|
+
one that delivered nothing, it waits 1 s, then 1.5, 2.25 and 3.375, capped at
|
|
201
|
+
5 s, starting at 1 s again once a connection delivers audio. Connections start
|
|
202
|
+
at least 1 s apart. `maxRetries` counts the connections in a row that delivered
|
|
203
|
+
nothing, so a stream that played and dropped reconnects once more than it.
|
|
204
|
+
|
|
205
|
+
On Android, a failure that media3 can resume within its connection, an HLS
|
|
206
|
+
segment or playlist and a file whose length the server declared, is retried in
|
|
207
|
+
place with the same backoff and keeps the buffered audio playing. It is not a
|
|
208
|
+
connection, so the rules above for connections don't hold for it: only the
|
|
209
|
+
duration budgets bound it, it keeps retrying every few seconds while offline,
|
|
210
|
+
it waits out its backoff once the network returns, and its loads can start
|
|
211
|
+
less than 1 s apart.
|
|
212
|
+
|
|
213
|
+
While it waits to reconnect, the player holds audio focus as it does while
|
|
214
|
+
playing. Another app taking the focus pauses it. A transient loss, a call
|
|
215
|
+
among them, holds the reconnect until the focus returns, then reconnects. At
|
|
216
|
+
the reconnect, the focus passes to the playing engine with a gap of a few
|
|
217
|
+
milliseconds: an app that asks for focus within it loses it again to the
|
|
218
|
+
reconnect, as it would to a tap on play.
|
|
219
|
+
|
|
220
|
+
Once a budget is exhausted the state lands on `'error'`, where your
|
|
221
|
+
`PlaybackErrorView` and [`retry()`](#manual-retry) take over.
|
|
218
222
|
|
|
219
223
|
Restarting from `'error'` — via `retry()` or any play command — begins a
|
|
220
224
|
**new load** of the same track: fresh budgets, starting with the
|
package/website/guide/network.md
CHANGED
|
@@ -14,9 +14,10 @@ exposes it three ways:
|
|
|
14
14
|
|
|
15
15
|
All three report the same boolean, but each platform decides it differently:
|
|
16
16
|
|
|
17
|
-
- **Android** asks the OS whether the default network
|
|
18
|
-
|
|
19
|
-
`
|
|
17
|
+
- **Android** asks the OS whether the default network offers internet. It does
|
|
18
|
+
not wait for the OS to validate it, so a network that never validates (a
|
|
19
|
+
failing Private DNS, some hotspots) reads `true`, and so can a captive or
|
|
20
|
+
dead Wi-Fi.
|
|
20
21
|
- **iOS** reads the system path monitor (`NWPathMonitor`), which reports
|
|
21
22
|
whether a usable network path exists. It does not check that the internet is
|
|
22
23
|
reachable, so a captive or dead Wi-Fi can read `true`.
|