react-native-audio-browser 0.2.0-next.83 → 0.2.0-next.85

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.
Files changed (44) hide show
  1. package/android/src/main/java/com/audiobrowser/player/InterceptingPlayer.kt +31 -9
  2. package/android/src/main/java/com/audiobrowser/player/MediaFactory.kt +39 -46
  3. package/android/src/main/java/com/audiobrowser/player/Player.kt +220 -54
  4. package/android/src/main/java/com/audiobrowser/player/PlayerEngineFactory.kt +5 -6
  5. package/android/src/main/java/com/audiobrowser/player/PlayerListener.kt +94 -79
  6. package/android/src/main/java/com/audiobrowser/player/ReconnectPacer.kt +8 -9
  7. package/android/src/main/java/com/audiobrowser/player/RetryFocus.kt +126 -0
  8. package/android/src/main/java/com/audiobrowser/player/RetryLoadErrorHandlingPolicy.kt +55 -121
  9. package/android/src/main/java/com/audiobrowser/player/RetryLocks.kt +52 -0
  10. package/android/src/main/java/com/audiobrowser/player/RetryLoop.kt +310 -0
  11. package/android/src/main/java/com/audiobrowser/player/RetryView.kt +31 -0
  12. package/android/src/main/java/com/audiobrowser/player/SessionViewListener.kt +148 -0
  13. package/android/src/main/java/com/audiobrowser/remote/RemoteOutputsController.kt +4 -1
  14. package/android/src/main/java/com/audiobrowser/remote/RemoteSwitchingPlayer.kt +15 -22
  15. package/android/src/main/java/com/audiobrowser/util/NetworkConnectivityMonitor.kt +4 -6
  16. package/android/src/test/java/androidx/media3/session/SessionViews.kt +9 -0
  17. package/android/src/test/java/com/audiobrowser/NetworkFixtures.kt +25 -0
  18. package/android/src/test/java/com/audiobrowser/player/LiveStreamEndTest.kt +15 -53
  19. package/android/src/test/java/com/audiobrowser/player/PlayerRetryTest.kt +207 -53
  20. package/android/src/test/java/com/audiobrowser/player/PlayerTrackChangeTest.kt +23 -0
  21. package/android/src/test/java/com/audiobrowser/player/RetryFocusTest.kt +97 -0
  22. package/android/src/test/java/com/audiobrowser/player/RetryLoadErrorHandlingPolicyTest.kt +90 -152
  23. package/android/src/test/java/com/audiobrowser/player/RetryLocksTest.kt +48 -0
  24. package/android/src/test/java/com/audiobrowser/player/RetryLoopCaseTest.kt +181 -0
  25. package/android/src/test/java/com/audiobrowser/player/RetryLoopTest.kt +221 -0
  26. package/android/src/test/java/com/audiobrowser/player/RetryMaskingTest.kt +176 -0
  27. package/android/src/test/java/com/audiobrowser/player/SessionPlayTest.kt +2 -0
  28. package/android/src/test/java/com/audiobrowser/player/SessionViewListenerTest.kt +21 -0
  29. package/android/src/test/java/com/audiobrowser/player/SessionViewTest.kt +2 -0
  30. package/android/src/test/java/com/audiobrowser/remote/FakeRemote.kt +2 -1
  31. package/android/src/test/java/com/audiobrowser/remote/RemoteSwitchingPlayerTest.kt +37 -0
  32. package/android/src/test/java/com/audiobrowser/util/NetworkConnectivityMonitorTest.kt +13 -4
  33. package/lib/commonjs/features/player/setup.js +5 -4
  34. package/lib/commonjs/features/player/setup.js.map +1 -1
  35. package/lib/module/features/player/setup.js +5 -4
  36. package/lib/module/features/player/setup.js.map +1 -1
  37. package/lib/typescript/src/features/player/setup.d.ts +19 -13
  38. package/lib/typescript/src/features/player/setup.d.ts.map +1 -1
  39. package/package.json +1 -1
  40. package/src/features/player/setup.ts +19 -13
  41. package/website/guide/errors.md +42 -38
  42. package/website/guide/network.md +4 -3
  43. package/android/src/main/java/com/audiobrowser/player/StuckRecoveryPolicy.kt +0 -37
  44. package/android/src/test/java/com/audiobrowser/player/StuckRecoveryPolicyTest.kt +0 -40
@@ -0,0 +1,221 @@
1
+ package com.audiobrowser.player
2
+
3
+ import androidx.media3.common.PlaybackException
4
+ import androidx.media3.common.Player as MediaPlayer
5
+ import org.junit.Assert.assertEquals
6
+ import org.junit.Assert.assertFalse
7
+ import org.junit.Assert.assertNull
8
+ import org.junit.Assert.assertTrue
9
+ import org.junit.Test
10
+
11
+ /** What the loop does around its engine that the case file's timelines do not reach. */
12
+ class RetryLoopTest {
13
+ private var now = 0L
14
+ private val tasks = mutableListOf<Pair<Long, () -> Unit>>()
15
+ private var reconnects = 0
16
+ private var gaveUp = false
17
+ private var holding = false
18
+ private var keeping = false
19
+
20
+ private val loop =
21
+ RetryLoop(
22
+ clock = { now },
23
+ timer = { delayMs, action ->
24
+ val task = (now + delayMs) to action
25
+ tasks += task
26
+ val cancel: () -> Unit = { tasks.remove(task) }
27
+ cancel
28
+ },
29
+ engine =
30
+ object : RetryLoop.Engine {
31
+ override fun reconnect() {
32
+ reconnects++
33
+ }
34
+
35
+ override fun awaitNetwork() {}
36
+
37
+ override fun holdChanged(held: Boolean, kept: Boolean) {
38
+ holding = held
39
+ keeping = kept
40
+ }
41
+
42
+ override fun giveUp(cause: PlaybackException?) {
43
+ gaveUp = true
44
+ }
45
+ },
46
+ maxRetries = null,
47
+ recoveryMs = 120_000,
48
+ firstConnectMs = 12_000,
49
+ online = true,
50
+ )
51
+
52
+ private fun advanceTo(at: Long) {
53
+ while (true) {
54
+ val next = tasks.filter { it.first <= at }.minByOrNull { it.first } ?: break
55
+ tasks.remove(next)
56
+ now = maxOf(now, next.first)
57
+ next.second()
58
+ }
59
+ now = at
60
+ }
61
+
62
+ /** A Load that played from 0 and whose connection ended at [at], its error surfaced. */
63
+ private fun playedAndEnded(at: Long) {
64
+ loop.loadStarted()
65
+ loop.playIntentChanged(true)
66
+ advanceTo(500)
67
+ loop.isPlayingChanged(true)
68
+ advanceTo(at)
69
+ loop.isPlayingChanged(false)
70
+ loop.connectionFailed(inPlace = false, atMs = at)
71
+ assertTrue(loop.onPlayerError(null, stuck = false))
72
+ }
73
+
74
+ @Test
75
+ fun `a transient focus loss during a reconnect wait reconnects when it ends`() {
76
+ playedAndEnded(at = 30_000)
77
+ loop.connectionStarted()
78
+ advanceTo(30_100)
79
+ loop.connectionFailed(inPlace = false, atMs = 30_100)
80
+ loop.onPlayerError(null, stuck = false)
81
+ assertEquals(31_100L, loop.reconnectDueMs)
82
+
83
+ // The suppression drops the intent and, unlike a pause, prepares nothing when it ends.
84
+ loop.playIntentChanged(false)
85
+ advanceTo(40_000)
86
+ assertEquals(0, reconnects)
87
+ loop.playIntentChanged(true)
88
+ advanceTo(40_000)
89
+
90
+ assertEquals(1, reconnects)
91
+ }
92
+
93
+ @Test
94
+ fun `a terminal error elsewhere stops the loop until a new Load`() {
95
+ loop.loadStarted()
96
+ loop.playIntentChanged(true)
97
+ assertEquals(120_000L, loop.deadlineMs)
98
+
99
+ loop.suspend()
100
+ advanceTo(200_000)
101
+
102
+ assertFalse("the old deadline fired", gaveUp)
103
+ assertTrue(loop.stopped)
104
+ loop.loadStarted()
105
+ assertEquals(320_000L, loop.deadlineMs)
106
+ }
107
+
108
+ @Test
109
+ fun `the audio a failed connection's buffer plays counts as delivered`() {
110
+ loop.loadStarted()
111
+ loop.playIntentChanged(true)
112
+ advanceTo(300)
113
+ // The burst arrived and the server closed before anything played.
114
+ loop.connectionFailed(inPlace = false, atMs = 300)
115
+ advanceTo(1_000)
116
+ loop.isPlayingChanged(true)
117
+ advanceTo(3_000)
118
+ loop.isPlayingChanged(false)
119
+ loop.onPlayerError(null, stuck = false)
120
+
121
+ // Delivered audio reconnects as soon as the 1 s floor allows, not after the first backoff.
122
+ assertEquals(3_000L, loop.reconnectDueMs)
123
+ }
124
+
125
+ @Test
126
+ fun `an error that arrives after the engine was stopped is still the loop's`() {
127
+ loop.loadStarted()
128
+ loop.playIntentChanged(true)
129
+ loop.connectionFailed(inPlace = false, atMs = 300)
130
+ loop.playIntentChanged(false)
131
+ loop.engineStopped()
132
+
133
+ assertTrue(loop.onPlayerError(null, stuck = false))
134
+ assertNull("a paused loop reconnects nothing", loop.reconnectDueMs)
135
+ }
136
+
137
+ @Test
138
+ fun `a connection that starts over a pending failure starts clean`() {
139
+ loop.loadStarted()
140
+ loop.playIntentChanged(true)
141
+ loop.connectionFailed(inPlace = false, atMs = 300)
142
+
143
+ loop.connectionStarted()
144
+
145
+ assertFalse(loop.failurePending)
146
+ assertFalse(loop.reconnecting)
147
+ loop.connectionFailed(inPlace = false, atMs = 2_000)
148
+ assertTrue("the new connection's end is the loop's", loop.onPlayerError(null, stuck = false))
149
+ }
150
+
151
+ @Test
152
+ fun `holds the device awake only while it keeps the idle engine for a play intent`() {
153
+ playedAndEnded(at = 30_000)
154
+ assertTrue("held between connections", holding)
155
+
156
+ loop.playIntentChanged(false)
157
+ assertFalse("held over a pause", holding)
158
+ assertTrue("the idle engine still kept", keeping)
159
+ loop.playIntentChanged(true)
160
+ assertTrue(holding)
161
+
162
+ advanceTo(31_000)
163
+ loop.connectionStarted()
164
+ assertFalse("held over a connection", holding)
165
+
166
+ loop.connectionFailed(inPlace = false, atMs = 31_100)
167
+ loop.onPlayerError(null, stuck = false)
168
+ advanceTo(200_000)
169
+ assertTrue(gaveUp)
170
+ assertFalse("held after the give-up", holding)
171
+ assertFalse("kept after the give-up", keeping)
172
+ }
173
+
174
+ @Test
175
+ fun `a stuck engine reconnects as a plain connection end`() {
176
+ playedAndEnded(at = 30_000)
177
+ advanceTo(30_000)
178
+ loop.connectionStarted()
179
+ advanceTo(31_500)
180
+ loop.isPlayingChanged(true)
181
+ advanceTo(100_000)
182
+ loop.isPlayingChanged(false)
183
+
184
+ assertTrue(loop.onPlayerError(null, stuck = true))
185
+ assertEquals(100_000L, loop.reconnectDueMs)
186
+ }
187
+ }
188
+
189
+ class RetryViewTest {
190
+ @Test
191
+ fun `the loop's idle engine reads buffering, a settled one idle`() {
192
+ assertEquals(
193
+ MediaPlayer.STATE_BUFFERING,
194
+ RetryView.engineState(MediaPlayer.STATE_IDLE, true, false, 0),
195
+ )
196
+ assertEquals(
197
+ MediaPlayer.STATE_IDLE,
198
+ RetryView.engineState(MediaPlayer.STATE_IDLE, false, false, 0),
199
+ )
200
+ }
201
+
202
+ @Test
203
+ fun `a READY with nothing buffered over a failed connection is the blip`() {
204
+ assertEquals(
205
+ MediaPlayer.STATE_BUFFERING,
206
+ RetryView.engineState(MediaPlayer.STATE_READY, true, true, 0),
207
+ )
208
+ }
209
+
210
+ @Test
211
+ fun `a READY with audio buffered is real, failed connection or not`() {
212
+ assertEquals(
213
+ MediaPlayer.STATE_READY,
214
+ RetryView.engineState(MediaPlayer.STATE_READY, true, true, 2_000),
215
+ )
216
+ assertEquals(
217
+ MediaPlayer.STATE_READY,
218
+ RetryView.engineState(MediaPlayer.STATE_READY, false, false, 0),
219
+ )
220
+ }
221
+ }
@@ -0,0 +1,176 @@
1
+ package com.audiobrowser.player
2
+
3
+ import android.os.Looper
4
+ import android.support.v4.media.session.PlaybackStateCompat
5
+ import androidx.media3.common.C
6
+ import androidx.media3.common.Player as MediaPlayer
7
+ import androidx.media3.session.MediaSession
8
+ import androidx.media3.session.controllerError
9
+ import androidx.media3.session.controllerPlaying
10
+ import androidx.media3.session.controllerState
11
+ import androidx.media3.session.legacyState
12
+ import com.audiobrowser.Callbacks
13
+ import com.audiobrowser.TestFixtures
14
+ import com.audiobrowser.goOnline
15
+ import com.audiobrowser.model.PlayerSetupOptions
16
+ import com.audiobrowser.model.RetryPolicy
17
+ import com.audiobrowser.util.TrackFactory
18
+ import com.margelo.nitro.audiobrowser.Playback
19
+ import com.margelo.nitro.audiobrowser.PlaybackState
20
+ import java.io.IOException
21
+ import java.net.ServerSocket
22
+ import java.time.Duration
23
+ import java.util.concurrent.atomic.AtomicInteger
24
+ import kotlin.concurrent.thread
25
+ import org.junit.After
26
+ import org.junit.Assert.assertEquals
27
+ import org.junit.Assert.assertFalse
28
+ import org.junit.Assert.assertNotEquals
29
+ import org.junit.Assert.assertNull
30
+ import org.junit.Assert.assertTrue
31
+ import org.junit.Assert.fail
32
+ import org.junit.Test
33
+ import org.junit.runner.RunWith
34
+ import org.mockito.Mockito.mock
35
+ import org.mockito.Mockito.mockingDetails
36
+ import org.robolectric.RobolectricTestRunner
37
+ import org.robolectric.RuntimeEnvironment
38
+ import org.robolectric.Shadows.shadowOf
39
+ import org.robolectric.annotation.Config
40
+ import org.robolectric.shadows.ShadowSystemClock
41
+
42
+ /**
43
+ * While the retry loop holds the engine, its idle engine and its error reach no one: not JS (the
44
+ * callbacks), not media3 controllers such as the notification (the session's player info), not
45
+ * Android Auto and the system UI (the legacy session). Each surface is read after every turn of the
46
+ * main looper, as a controller would be told. The READY blip needs decoded audio, which these tests
47
+ * never play: [RetryViewTest] covers its view.
48
+ */
49
+ @RunWith(RobolectricTestRunner::class)
50
+ @Config(sdk = [28])
51
+ class RetryMaskingTest {
52
+
53
+ private val context = RuntimeEnvironment.getApplication()
54
+ private val player = Player(context)
55
+ private val callbacks = mock(Callbacks::class.java)
56
+ private lateinit var session: MediaSession
57
+
58
+ @After
59
+ fun release() {
60
+ server.close()
61
+ session.release()
62
+ player.networkMonitor.destroy()
63
+ player.exoPlayer.release()
64
+ }
65
+
66
+ private val server = ServerSocket(0)
67
+ private val connections = AtomicInteger()
68
+
69
+ init {
70
+ // Takes each connection and ends it unanswered: a recoverable failure of a live stream.
71
+ thread(isDaemon = true) {
72
+ while (!server.isClosed) {
73
+ try {
74
+ server.accept().close()
75
+ connections.incrementAndGet()
76
+ } catch (_: IOException) {
77
+ return@thread
78
+ }
79
+ }
80
+ }
81
+ }
82
+
83
+ @Test
84
+ fun `the loop reconnects, and its idle engine and error reach no surface`() {
85
+ play("http://127.0.0.1:${server.localPort}/live.mp3")
86
+ var held = 0
87
+ stepUntil("the loop holding the idle engine a while") {
88
+ if (player.exoPlayer.playbackState == MediaPlayer.STATE_IDLE) {
89
+ assertTrue("the loop holds the idle engine", player.retryLoop!!.reconnecting)
90
+ held++
91
+ }
92
+ if (player.retryLoop!!.reconnecting) assertLoading()
93
+ held >= 30 && connections.get() >= 3
94
+ }
95
+ assertNoTerminalError()
96
+ }
97
+
98
+ @Test
99
+ fun `a give-up while the loop holds the idle engine leaves no surface buffering`() {
100
+ play(
101
+ "http://127.0.0.1:${server.localPort}/live.mp3",
102
+ RetryPolicy.Infinite(firstConnectMaxRetryDurationMs = 2_000),
103
+ )
104
+ stepUntil("the give-up") { player.playbackState == PlaybackState.ERROR }
105
+
106
+ assertNotEquals("media3 controllers", MediaPlayer.STATE_BUFFERING, session.controllerState())
107
+ assertNotEquals(
108
+ "legacy controllers",
109
+ PlaybackStateCompat.STATE_BUFFERING,
110
+ session.legacyState(),
111
+ )
112
+ }
113
+
114
+ private fun assertLoading() {
115
+ assertTrue(
116
+ "JS: ${player.playbackState}",
117
+ player.playbackState in setOf(PlaybackState.LOADING, PlaybackState.BUFFERING),
118
+ )
119
+ assertEquals("media3 controllers", MediaPlayer.STATE_BUFFERING, session.controllerState())
120
+ assertNull("media3 controllers", session.controllerError())
121
+ assertFalse("media3 controllers", session.controllerPlaying())
122
+ assertEquals("legacy controllers", PlaybackStateCompat.STATE_BUFFERING, session.legacyState())
123
+ }
124
+
125
+ private fun assertNoTerminalError() {
126
+ assertFalse(
127
+ "JS heard a terminal error",
128
+ mockingDetails(callbacks).invocations.any {
129
+ it.method.name == "onPlaybackError" && it.arguments[0] != null
130
+ },
131
+ )
132
+ assertFalse(
133
+ "JS heard the engine idle",
134
+ mockingDetails(callbacks).invocations.any {
135
+ it.method.name == "onPlaybackChanged" &&
136
+ (it.arguments[0] as Playback).state in setOf(PlaybackState.NONE, PlaybackState.ERROR)
137
+ },
138
+ )
139
+ }
140
+
141
+ private fun play(src: String, retryPolicy: RetryPolicy = RetryPolicy.Infinite()) {
142
+ goOnline(context)
143
+ player.setup(PlayerSetupOptions(retryPolicy = retryPolicy))
144
+ player.setCallbacks(callbacks)
145
+ session = MediaSession.Builder(context, player.forwardingPlayer).build()
146
+ player.setMediaSession(session)
147
+ player.exoPlayer.trackSelectionParameters =
148
+ player.exoPlayer.trackSelectionParameters
149
+ .buildUpon()
150
+ .setTrackTypeDisabled(C.TRACK_TYPE_AUDIO, true)
151
+ .build()
152
+ player.exoPlayer.setMediaItems(
153
+ listOf(TrackFactory.toMedia3(TestFixtures.track(src = src).copy(live = true)))
154
+ )
155
+ player.exoPlayer.prepare()
156
+ player.play()
157
+ }
158
+
159
+ /** Steps the clock 100 ms and the main looper a turn at a time, checking [step] after each. */
160
+ private fun stepUntil(what: String, step: () -> Boolean) {
161
+ val deadline = System.currentTimeMillis() + 10_000
162
+ while (!step()) {
163
+ if (System.currentTimeMillis() > deadline)
164
+ fail(
165
+ "timed out waiting for $what: ${player.playbackState}, exo ${player.exoPlayer.playbackState}"
166
+ )
167
+ ShadowSystemClock.advanceBy(Duration.ofMillis(100))
168
+ Thread.sleep(10)
169
+ val looper = shadowOf(Looper.getMainLooper())
170
+ while (!looper.isIdle) {
171
+ looper.runOneTask()
172
+ step()
173
+ }
174
+ }
175
+ }
176
+ }
@@ -7,6 +7,7 @@ import androidx.media3.common.Player as MediaPlayer
7
7
  import androidx.media3.common.util.Util
8
8
  import com.audiobrowser.Callbacks
9
9
  import com.audiobrowser.TestFixtures
10
+ import com.audiobrowser.goOnline
10
11
  import com.audiobrowser.model.PlayerSetupOptions
11
12
  import com.audiobrowser.model.RetryPolicy
12
13
  import com.audiobrowser.util.TrackFactory
@@ -173,6 +174,7 @@ class SessionPlayTest {
173
174
  }
174
175
 
175
176
  private fun load(src: String, retryPolicy: RetryPolicy = RetryPolicy.Default) {
177
+ goOnline(context)
176
178
  player.setup(PlayerSetupOptions(retryPolicy = retryPolicy))
177
179
  player.setCallbacks(callbacks)
178
180
  player.exoPlayer.trackSelectionParameters =
@@ -0,0 +1,21 @@
1
+ package com.audiobrowser.player
2
+
3
+ import androidx.media3.common.Player as MediaPlayer
4
+ import org.junit.Assert.assertEquals
5
+ import org.junit.Test
6
+
7
+ class SessionViewListenerTest {
8
+ @Test
9
+ fun `forwards every callback media3's listener declares`() {
10
+ val declared =
11
+ MediaPlayer.Listener::class.java.declaredMethods.map { it.name to it.parameterTypes.toList() }
12
+ val overridden =
13
+ SessionViewListener::class
14
+ .java
15
+ .declaredMethods
16
+ .map { it.name to it.parameterTypes.toList() }
17
+ .toSet()
18
+
19
+ assertEquals(emptyList<Any>(), declared.filterNot { it in overridden })
20
+ }
21
+ }
@@ -10,6 +10,7 @@ import androidx.media3.session.legacy.PlaybackStateCompat
10
10
  import androidx.media3.session.legacyState
11
11
  import com.audiobrowser.Callbacks
12
12
  import com.audiobrowser.TestFixtures
13
+ import com.audiobrowser.goOnline
13
14
  import com.audiobrowser.model.PlayerSetupOptions
14
15
  import com.audiobrowser.model.RetryPolicy
15
16
  import com.audiobrowser.util.TrackFactory
@@ -136,6 +137,7 @@ class SessionViewTest {
136
137
  }
137
138
 
138
139
  private fun play(retryPolicy: RetryPolicy, src: String = "https://127.0.0.1:9/stream") {
140
+ goOnline(context)
139
141
  player.setup(PlayerSetupOptions(retryPolicy = retryPolicy))
140
142
  player.setCallbacks(callbacks)
141
143
  session = MediaSession.Builder(context, player.forwardingPlayer).build()
@@ -30,7 +30,7 @@ internal class FakeLocalPlayer(looper: Looper) : SimpleBasePlayer(looper) {
30
30
 
31
31
  /**
32
32
  * Sends a stream title. ExoPlayer sends each one it decodes; this state emits only a change, so a
33
- * stop clears it for the stream's first title after a reconnect to go out again.
33
+ * stop and a prepare clear it for the first title of each connection to go out.
34
34
  */
35
35
  fun title(title: String) {
36
36
  metadata = Metadata(0, IcyInfo(title.toByteArray(), title, null))
@@ -91,6 +91,7 @@ internal class FakeLocalPlayer(looper: Looper) : SimpleBasePlayer(looper) {
91
91
 
92
92
  override fun handlePrepare(): ListenableFuture<*> {
93
93
  readiness = STATE_READY
94
+ metadata = Metadata(C.TIME_UNSET)
94
95
  prepares++
95
96
  return done()
96
97
  }
@@ -927,6 +927,43 @@ class RemoteSwitchingPlayerTest {
927
927
  assertEquals(listOf("Song"), seen)
928
928
  }
929
929
 
930
+ @Test
931
+ fun `each title the phone sends after a stop goes out, though it equals the last`() {
932
+ playLocally(listOf("a"))
933
+ local.title("Song")
934
+ idle()
935
+ val seen = transitionsAndTitles()
936
+
937
+ player.stop()
938
+ idle()
939
+ // A title that runs after the stop: passed on here, and dropped by the player's listener.
940
+ local.title("Song")
941
+ idle()
942
+ player.prepare()
943
+ idle()
944
+ local.title("Song")
945
+ idle()
946
+
947
+ assertEquals(listOf("Song", "Song"), seen)
948
+ }
949
+
950
+ @Test
951
+ fun `a title after the phone reconnects without a stop goes out, though it equals the last`() {
952
+ playLocally(listOf("a"))
953
+ local.title("Song")
954
+ idle()
955
+ val seen = transitionsAndTitles()
956
+
957
+ // As the retry loop reconnects: on the phone, not through this player.
958
+ local.stop()
959
+ local.prepare()
960
+ idle()
961
+ local.title("Song")
962
+ idle()
963
+
964
+ assertEquals(listOf("Song"), seen)
965
+ }
966
+
930
967
  @Test
931
968
  fun `release brings playback back and lets every remote go`() {
932
969
  playLocally(listOf("a"))
@@ -53,6 +53,8 @@ class NetworkConnectivityMonitorTest {
53
53
  shadowOf(it).addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
54
54
  }
55
55
 
56
+ private fun noInternet() = ShadowNetworkCapabilities.newInstance()
57
+
56
58
  private fun becomesDefault(network: Network) {
57
59
  callback.onAvailable(network)
58
60
  callback.onCapabilitiesChanged(network, connectivityManager.getNetworkCapabilities(network)!!)
@@ -74,17 +76,24 @@ class NetworkConnectivityMonitorTest {
74
76
  }
75
77
 
76
78
  @Test
77
- fun `is offline while the default network is not validated`() {
79
+ fun `is online on a default network with internet that never validates`() {
78
80
  shadow.setNetworkCapabilities(wifi, unvalidated())
79
81
  becomesDefault(wifi)
82
+ assertTrue(monitor.getOnline())
83
+ }
84
+
85
+ @Test
86
+ fun `is offline while the default network has no internet`() {
87
+ shadow.setNetworkCapabilities(wifi, noInternet())
88
+ becomesDefault(wifi)
80
89
  assertFalse(monitor.getOnline())
81
- callback.onCapabilitiesChanged(wifi, validated())
90
+ callback.onCapabilitiesChanged(wifi, unvalidated())
82
91
  assertTrue(monitor.getOnline())
83
92
  }
84
93
 
85
94
  @Test
86
95
  fun `takes the capabilities of a new default network on its arrival`() {
87
- shadow.setNetworkCapabilities(wifi, unvalidated())
96
+ shadow.setNetworkCapabilities(wifi, noInternet())
88
97
  becomesDefault(mobile)
89
98
  callback.onAvailable(wifi)
90
99
  assertFalse(monitor.getOnline())
@@ -93,7 +102,7 @@ class NetworkConnectivityMonitorTest {
93
102
  @Test
94
103
  fun `ignores capability changes of a network that is not the default`() {
95
104
  becomesDefault(wifi)
96
- callback.onCapabilitiesChanged(mobile, unvalidated())
105
+ callback.onCapabilitiesChanged(mobile, noInternet())
97
106
  assertTrue(monitor.getOnline())
98
107
  }
99
108
  }
@@ -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** (the load played, then failed): retries are bounded by
192
- * `maxRetryDurationMs`. Playback proved the stream works; drops are usually
193
- * transient (tunnels, network handovers, a station's encoder restarting)
194
- * and patience is what recovers them unattended.
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;;AA2BA;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;;AA4FA;;AAMA;AACA,SAASE,iBAAiBA,CACxBC,KAAuC,EACjB;EACtB,IAAI,OAAOA,KAAK,KAAK,UAAU,EAAE;IAC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AAC,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":[]}
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;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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** (the load played, then failed): retries are bounded by
189
- * `maxRetryDurationMs`. Playback proved the stream works; drops are usually
190
- * transient (tunnels, network handovers, a station's encoder restarting)
191
- * and patience is what recovers them unattended.
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;;AA2BA;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;;AA4FA;;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,KAAK;IAC5D,CAAC;EACH;EACA;EACA,OAAO;IACLC,4BAA4B,EAAED,KAAK,IAAI,IAAI;IAC3CE,2BAA2B,EAAEE;EAC/B,CAA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C,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":[]}
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,iBAAi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