react-native-audio-browser 0.2.0-next.49 → 0.2.0-next.50
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/build.gradle +1 -0
- package/android/src/main/java/com/audiobrowser/AudioBrowser.kt +4 -0
- package/android/src/main/java/com/audiobrowser/RemoteOutputs.kt +128 -0
- package/android/src/main/java/com/audiobrowser/util/OutputMonitor.kt +22 -1
- package/android/src/test/java/com/audiobrowser/RemoteOutputsTest.kt +22 -0
- package/android/src/test/java/com/audiobrowser/util/OutputMonitorTest.kt +95 -0
- package/lib/commonjs/features/output.js +3 -2
- package/lib/commonjs/features/output.js.map +1 -1
- package/lib/commonjs/features/player/setup.js.map +1 -1
- package/lib/module/features/output.js +3 -2
- package/lib/module/features/output.js.map +1 -1
- package/lib/module/features/player/setup.js.map +1 -1
- package/lib/typescript/src/features/output.d.ts +3 -2
- package/lib/typescript/src/features/output.d.ts.map +1 -1
- package/lib/typescript/src/features/player/setup.d.ts +12 -0
- package/lib/typescript/src/features/player/setup.d.ts.map +1 -1
- package/lib/typescript/src/specs/audio-browser.nitro.d.ts +3 -4
- package/lib/typescript/src/specs/audio-browser.nitro.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JNativeSetupPlayerOptions.hpp +7 -3
- package/nitrogen/generated/android/c++/JOutputType.hpp +3 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/NativeSetupPlayerOptions.kt +11 -6
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/OutputType.kt +2 -1
- package/nitrogen/generated/ios/swift/NativeSetupPlayerOptions.swift +19 -1
- package/nitrogen/generated/ios/swift/OutputType.swift +4 -0
- package/nitrogen/generated/shared/c++/NativeSetupPlayerOptions.hpp +6 -2
- package/nitrogen/generated/shared/c++/OutputType.hpp +5 -1
- package/package.json +1 -1
- package/src/features/output.ts +3 -2
- package/src/features/player/setup.ts +18 -1
- package/src/specs/audio-browser.nitro.ts +4 -4
- package/website/guide/audio-output.md +28 -5
- package/website/guide/configuration.md +1 -1
package/android/build.gradle
CHANGED
|
@@ -185,6 +185,7 @@ dependencies {
|
|
|
185
185
|
implementation "androidx.car.app:app:1.4.0"
|
|
186
186
|
implementation "androidx.lifecycle:lifecycle-process:2.8.6"
|
|
187
187
|
implementation 'androidx.media:media:1.7.0'
|
|
188
|
+
implementation "androidx.mediarouter:mediarouter:1.8.1"
|
|
188
189
|
|
|
189
190
|
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.6")
|
|
190
191
|
|
|
@@ -229,6 +229,7 @@ class AudioBrowser : HybridAudioBrowserSpec(), ServiceConnection {
|
|
|
229
229
|
private var updateOptions: PlayerUpdateOptions = PlayerUpdateOptions()
|
|
230
230
|
private var mediaBrowserFuture: ListenableFuture<MediaBrowser>? = null
|
|
231
231
|
private var setupOptions = PlayerSetupOptions()
|
|
232
|
+
private var remoteOutputs = false
|
|
232
233
|
// Written only on the main thread (ServiceConnection callbacks, dispose); read from main or,
|
|
233
234
|
// in a few places, straight from the JS thread. @Volatile gives those reads visibility — they
|
|
234
235
|
// must still tolerate staleness in both directions (a just-detached service, or null while
|
|
@@ -860,6 +861,9 @@ class AudioBrowser : HybridAudioBrowserSpec(), ServiceConnection {
|
|
|
860
861
|
override fun setupPlayer(options: NativeSetupPlayerOptions): Promise<Unit> {
|
|
861
862
|
return Promise.async(mainScope) {
|
|
862
863
|
setupOptions.update(options)
|
|
864
|
+
options.remoteOutputs?.let { remoteOutputs = it }
|
|
865
|
+
// Applied even when omitted, so a reloaded bundle that omits the option turns it off.
|
|
866
|
+
RemoteOutputs.setEnabled(context, remoteOutputs)
|
|
863
867
|
// The bundled runtime options and initial state are part of the atomic launch
|
|
864
868
|
// description: stage them here, apply them together with the engine below (or at
|
|
865
869
|
// service connect). Last-write-wins with their imperative counterparts.
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
package com.audiobrowser
|
|
2
|
+
|
|
3
|
+
import android.content.ComponentName
|
|
4
|
+
import android.content.Context
|
|
5
|
+
import android.content.pm.PackageManager
|
|
6
|
+
import androidx.annotation.MainThread
|
|
7
|
+
import androidx.annotation.VisibleForTesting
|
|
8
|
+
import androidx.mediarouter.media.MediaRouteSelector
|
|
9
|
+
import androidx.mediarouter.media.MediaRouter
|
|
10
|
+
import androidx.mediarouter.media.MediaTransferReceiver
|
|
11
|
+
import com.audiobrowser.util.OutputSwitcher
|
|
12
|
+
import com.margelo.nitro.audiobrowser.Output
|
|
13
|
+
import com.margelo.nitro.audiobrowser.OutputType
|
|
14
|
+
import java.util.concurrent.CopyOnWriteArraySet
|
|
15
|
+
import timber.log.Timber
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Remote outputs: the speakers and TVs of media route providers, offered in the system Output
|
|
19
|
+
* Switcher next to the phone and Bluetooth, and the one selected there reported as the [Output].
|
|
20
|
+
* Only the selection is reported; rendering the audio there is the provider's job.
|
|
21
|
+
*
|
|
22
|
+
* Holds the process's one [MediaRouter] while enabled, on Android 11+ where the switcher exists. A
|
|
23
|
+
* provider's routes are offered when they declare [CATEGORY] in a control filter.
|
|
24
|
+
*/
|
|
25
|
+
object RemoteOutputs {
|
|
26
|
+
/** The control category a media route provider's routes declare to be offered as outputs. */
|
|
27
|
+
const val CATEGORY = "com.audiobrowser.CATEGORY_REMOTE_OUTPUT"
|
|
28
|
+
|
|
29
|
+
private val selector = MediaRouteSelector.Builder().addControlCategory(CATEGORY).build()
|
|
30
|
+
|
|
31
|
+
// The global router holds routers weakly: let this one go and the system Output Switcher stops
|
|
32
|
+
// listing the category's routes, as the app's discovery preference empties on the next GC.
|
|
33
|
+
private var router: MediaRouter? = null
|
|
34
|
+
|
|
35
|
+
private val listeners = CopyOnWriteArraySet<() -> Unit>()
|
|
36
|
+
|
|
37
|
+
/** The selected remote output, or null while playback stays local. Read from any thread. */
|
|
38
|
+
@Volatile
|
|
39
|
+
internal var current: Output? = null
|
|
40
|
+
private set
|
|
41
|
+
|
|
42
|
+
// A callback with a selector only hears of routes in the category: going back to the phone
|
|
43
|
+
// arrives as the remote route's unselect, not as the phone's select.
|
|
44
|
+
private val callback =
|
|
45
|
+
object : MediaRouter.Callback() {
|
|
46
|
+
override fun onRouteSelected(
|
|
47
|
+
router: MediaRouter,
|
|
48
|
+
selectedRoute: MediaRouter.RouteInfo,
|
|
49
|
+
reason: Int,
|
|
50
|
+
) = update(router)
|
|
51
|
+
|
|
52
|
+
override fun onRouteUnselected(
|
|
53
|
+
router: MediaRouter,
|
|
54
|
+
route: MediaRouter.RouteInfo,
|
|
55
|
+
reason: Int,
|
|
56
|
+
) = update(router)
|
|
57
|
+
|
|
58
|
+
override fun onRouteChanged(router: MediaRouter, route: MediaRouter.RouteInfo) =
|
|
59
|
+
update(router)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Turns remote outputs on or off. Idempotent. */
|
|
63
|
+
@MainThread
|
|
64
|
+
internal fun setEnabled(context: Context, enabled: Boolean) {
|
|
65
|
+
if (enabled) start(context) else stop()
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Calls [listener] on the main thread whenever [current] changes. */
|
|
69
|
+
internal fun addListener(listener: () -> Unit) {
|
|
70
|
+
listeners.add(listener)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
internal fun removeListener(listener: () -> Unit) {
|
|
74
|
+
listeners.remove(listener)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
private fun start(context: Context) {
|
|
78
|
+
if (router != null || !OutputSwitcher.isSupported()) return
|
|
79
|
+
warnWithoutTransferReceiver(context)
|
|
80
|
+
val router = MediaRouter.getInstance(context.applicationContext)
|
|
81
|
+
this.router = router
|
|
82
|
+
router.addCallback(selector, callback, MediaRouter.CALLBACK_FLAG_REQUEST_DISCOVERY)
|
|
83
|
+
update(router)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
private fun stop() {
|
|
87
|
+
val router = router ?: return
|
|
88
|
+
router.removeCallback(callback)
|
|
89
|
+
if (router.selectedRoute.matchesSelector(selector)) {
|
|
90
|
+
router.unselect(MediaRouter.UNSELECT_REASON_STOPPED)
|
|
91
|
+
}
|
|
92
|
+
this.router = null
|
|
93
|
+
setCurrent(null)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Never throws: a failed check must not keep [start] from setting up the router. */
|
|
97
|
+
private fun warnWithoutTransferReceiver(context: Context) {
|
|
98
|
+
try {
|
|
99
|
+
context.packageManager.getReceiverInfo(
|
|
100
|
+
ComponentName(context, MediaTransferReceiver::class.java),
|
|
101
|
+
PackageManager.GET_META_DATA,
|
|
102
|
+
)
|
|
103
|
+
} catch (e: Exception) {
|
|
104
|
+
Timber.w(
|
|
105
|
+
e,
|
|
106
|
+
"RemoteOutputs: found no MediaTransferReceiver in the app's manifest, so the Output Switcher won't list remote outputs",
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
private fun update(router: MediaRouter) {
|
|
112
|
+
val route = router.selectedRoute
|
|
113
|
+
setCurrent(remoteOutputOf(name = route.name, offersCategory = route.matchesSelector(selector)))
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@VisibleForTesting
|
|
117
|
+
@MainThread
|
|
118
|
+
internal fun setCurrent(output: Output?) {
|
|
119
|
+
if (output == current) return
|
|
120
|
+
current = output
|
|
121
|
+
Timber.d("RemoteOutputs: %s", output?.name ?: "local")
|
|
122
|
+
listeners.forEach { it() }
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** The [Output] a selected route stands for: null for a route outside [RemoteOutputs.CATEGORY]. */
|
|
127
|
+
internal fun remoteOutputOf(name: String, offersCategory: Boolean): Output? =
|
|
128
|
+
if (offersCategory) Output(type = OutputType.REMOTE, name = name, external = true) else null
|
|
@@ -11,6 +11,7 @@ import android.os.Looper
|
|
|
11
11
|
import androidx.lifecycle.DefaultLifecycleObserver
|
|
12
12
|
import androidx.lifecycle.LifecycleOwner
|
|
13
13
|
import androidx.lifecycle.ProcessLifecycleOwner
|
|
14
|
+
import com.audiobrowser.RemoteOutputs
|
|
14
15
|
import com.margelo.nitro.audiobrowser.Output
|
|
15
16
|
import com.margelo.nitro.audiobrowser.OutputType
|
|
16
17
|
import timber.log.Timber
|
|
@@ -43,6 +44,9 @@ import timber.log.Timber
|
|
|
43
44
|
* over the connected output devices; that fallback cannot detect a manual reroute while a device
|
|
44
45
|
* stays connected (the long-standing limitation).
|
|
45
46
|
*
|
|
47
|
+
* A selected [RemoteOutputs] route takes precedence over the local device. Unlike a local device's,
|
|
48
|
+
* a remote route's selection is reliable: the router owns it.
|
|
49
|
+
*
|
|
46
50
|
* Threading: [AudioManager] queries are thread-safe, so [current] recomputes live on read (safe
|
|
47
51
|
* from the JS thread's `getOutput()`); emitted change events come from the main-thread
|
|
48
52
|
* callbacks/poll.
|
|
@@ -80,6 +84,8 @@ class OutputMonitor(private val context: Context) : DefaultLifecycleObserver {
|
|
|
80
84
|
recompute("device-removed")
|
|
81
85
|
}
|
|
82
86
|
|
|
87
|
+
private val remoteOutputListener = { recompute("remote-output") }
|
|
88
|
+
|
|
83
89
|
// Backstop for manual reroutes, which emit no public event (see class doc).
|
|
84
90
|
// Only scheduled while in the foreground.
|
|
85
91
|
private val poll =
|
|
@@ -94,6 +100,7 @@ class OutputMonitor(private val context: Context) : DefaultLifecycleObserver {
|
|
|
94
100
|
fun start() {
|
|
95
101
|
mainHandler.post {
|
|
96
102
|
audioManager.registerAudioDeviceCallback(deviceCallback, mainHandler)
|
|
103
|
+
RemoteOutputs.addListener(remoteOutputListener)
|
|
97
104
|
// Delivers onStart synchronously if already foreground, kicking off the poll.
|
|
98
105
|
ProcessLifecycleOwner.get().lifecycle.addObserver(this)
|
|
99
106
|
}
|
|
@@ -120,11 +127,22 @@ class OutputMonitor(private val context: Context) : DefaultLifecycleObserver {
|
|
|
120
127
|
mainHandler.removeCallbacks(poll)
|
|
121
128
|
ProcessLifecycleOwner.get().lifecycle.removeObserver(this)
|
|
122
129
|
audioManager.unregisterAudioDeviceCallback(deviceCallback)
|
|
130
|
+
RemoteOutputs.removeListener(remoteOutputListener)
|
|
123
131
|
}
|
|
124
132
|
}
|
|
125
133
|
|
|
126
134
|
private fun recompute(reason: String) {
|
|
127
|
-
|
|
135
|
+
// A left remote output is no fallback for a local reading that came back empty: the phone
|
|
136
|
+
// speaker stands in, so listeners hear that the remote output is gone.
|
|
137
|
+
val output =
|
|
138
|
+
computeOutput()
|
|
139
|
+
?: if (cached?.type == OutputType.REMOTE)
|
|
140
|
+
Output(
|
|
141
|
+
type = OutputType.SPEAKER,
|
|
142
|
+
name = defaultName(OutputType.SPEAKER),
|
|
143
|
+
external = false,
|
|
144
|
+
)
|
|
145
|
+
else return
|
|
128
146
|
if (output == cached) return
|
|
129
147
|
cached = output
|
|
130
148
|
Timber.d("OutputMonitor [%s]: type=%s name=%s", reason, output.type, output.name)
|
|
@@ -132,6 +150,9 @@ class OutputMonitor(private val context: Context) : DefaultLifecycleObserver {
|
|
|
132
150
|
}
|
|
133
151
|
|
|
134
152
|
private fun computeOutput(): Output? {
|
|
153
|
+
RemoteOutputs.current?.let {
|
|
154
|
+
return it
|
|
155
|
+
}
|
|
135
156
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
136
157
|
val device =
|
|
137
158
|
audioManager.getAudioDevicesForAttributes(mediaAttributes).firstOrNull { it.isSink }
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package com.audiobrowser
|
|
2
|
+
|
|
3
|
+
import com.margelo.nitro.audiobrowser.Output
|
|
4
|
+
import com.margelo.nitro.audiobrowser.OutputType
|
|
5
|
+
import org.junit.Assert.assertEquals
|
|
6
|
+
import org.junit.Assert.assertNull
|
|
7
|
+
import org.junit.Test
|
|
8
|
+
|
|
9
|
+
class RemoteOutputsTest {
|
|
10
|
+
@Test
|
|
11
|
+
fun `a selected route in the category is a remote output`() {
|
|
12
|
+
assertEquals(
|
|
13
|
+
Output(type = OutputType.REMOTE, name = "Kitchen", external = true),
|
|
14
|
+
remoteOutputOf("Kitchen", offersCategory = true),
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@Test
|
|
19
|
+
fun `a selected route outside the category leaves the output to the local device`() {
|
|
20
|
+
assertNull(remoteOutputOf("Living room TV", offersCategory = false))
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
package com.audiobrowser.util
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.media.AudioDeviceInfo
|
|
5
|
+
import android.media.AudioManager
|
|
6
|
+
import android.os.Looper
|
|
7
|
+
import com.audiobrowser.RemoteOutputs
|
|
8
|
+
import com.margelo.nitro.audiobrowser.Output
|
|
9
|
+
import com.margelo.nitro.audiobrowser.OutputType
|
|
10
|
+
import org.junit.After
|
|
11
|
+
import org.junit.Assert.assertEquals
|
|
12
|
+
import org.junit.Before
|
|
13
|
+
import org.junit.Test
|
|
14
|
+
import org.junit.runner.RunWith
|
|
15
|
+
import org.mockito.Mockito.mock
|
|
16
|
+
import org.mockito.Mockito.`when`
|
|
17
|
+
import org.robolectric.RobolectricTestRunner
|
|
18
|
+
import org.robolectric.RuntimeEnvironment
|
|
19
|
+
import org.robolectric.Shadows.shadowOf
|
|
20
|
+
import org.robolectric.annotation.Config
|
|
21
|
+
|
|
22
|
+
// API 32: OutputMonitor reads connected devices there, which Robolectric shadows; it does not
|
|
23
|
+
// shadow API 33's getAudioDevicesForAttributes.
|
|
24
|
+
@RunWith(RobolectricTestRunner::class)
|
|
25
|
+
@Config(sdk = [32])
|
|
26
|
+
class OutputMonitorTest {
|
|
27
|
+
private lateinit var audioManager: AudioManager
|
|
28
|
+
private lateinit var monitor: OutputMonitor
|
|
29
|
+
private val emitted = mutableListOf<Output>()
|
|
30
|
+
|
|
31
|
+
private val kitchen = Output(type = OutputType.REMOTE, name = "Kitchen", external = true)
|
|
32
|
+
|
|
33
|
+
@Before
|
|
34
|
+
fun setUp() {
|
|
35
|
+
val context = RuntimeEnvironment.getApplication()
|
|
36
|
+
audioManager = context.getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
|
37
|
+
monitor = OutputMonitor(context)
|
|
38
|
+
monitor.setOnOutputChanged { emitted.add(it) }
|
|
39
|
+
monitor.start()
|
|
40
|
+
idle()
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@After
|
|
44
|
+
fun tearDown() {
|
|
45
|
+
monitor.destroy()
|
|
46
|
+
idle()
|
|
47
|
+
RemoteOutputs.setCurrent(null)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@Test
|
|
51
|
+
fun `a remote output takes precedence over the local device`() {
|
|
52
|
+
routeMediaTo(AudioDeviceInfo.TYPE_BUILTIN_SPEAKER)
|
|
53
|
+
|
|
54
|
+
RemoteOutputs.setCurrent(kitchen)
|
|
55
|
+
idle()
|
|
56
|
+
|
|
57
|
+
assertEquals(kitchen, monitor.current)
|
|
58
|
+
assertEquals(kitchen, emitted.last())
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@Test
|
|
62
|
+
fun `leaving the remote output reports the local device again`() {
|
|
63
|
+
routeMediaTo(AudioDeviceInfo.TYPE_BUILTIN_SPEAKER)
|
|
64
|
+
RemoteOutputs.setCurrent(kitchen)
|
|
65
|
+
idle()
|
|
66
|
+
|
|
67
|
+
RemoteOutputs.setCurrent(null)
|
|
68
|
+
idle()
|
|
69
|
+
|
|
70
|
+
assertEquals(OutputType.SPEAKER, monitor.current?.type)
|
|
71
|
+
assertEquals(OutputType.SPEAKER, emitted.last().type)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@Test
|
|
75
|
+
fun `leaving the remote output with no local reading reports the phone speaker`() {
|
|
76
|
+
RemoteOutputs.setCurrent(kitchen)
|
|
77
|
+
idle()
|
|
78
|
+
|
|
79
|
+
RemoteOutputs.setCurrent(null)
|
|
80
|
+
idle()
|
|
81
|
+
|
|
82
|
+
val phoneSpeaker = Output(type = OutputType.SPEAKER, name = "Phone speaker", external = false)
|
|
83
|
+
assertEquals(phoneSpeaker, emitted.last())
|
|
84
|
+
assertEquals(phoneSpeaker, monitor.current)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
private fun routeMediaTo(deviceType: Int) {
|
|
88
|
+
val device = mock(AudioDeviceInfo::class.java)
|
|
89
|
+
`when`(device.type).thenReturn(deviceType)
|
|
90
|
+
`when`(device.productName).thenReturn("Pixel")
|
|
91
|
+
shadowOf(audioManager).addOutputDevice(device, false)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
private fun idle() = shadowOf(Looper.getMainLooper()).idle()
|
|
95
|
+
}
|
|
@@ -40,8 +40,9 @@ function supportsOutputSwitcher() {
|
|
|
40
40
|
/**
|
|
41
41
|
* The current audio output, or `undefined` when unknown. iOS reports one while a
|
|
42
42
|
* session is active; Android reports the active output route via AudioManager
|
|
43
|
-
* (the `type` is coarse — e.g. wired headphones may report as `speaker`)
|
|
44
|
-
*
|
|
43
|
+
* (the `type` is coarse — e.g. wired headphones may report as `speaker`), or the
|
|
44
|
+
* remote output selected in the Output Switcher when `remoteOutputs` is on.
|
|
45
|
+
* Guard for `undefined`.
|
|
45
46
|
*/
|
|
46
47
|
function getOutput() {
|
|
47
48
|
return _native.nativeBrowser.getOutput();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_native","require","_NativeUpdatedValue","_useNativeUpdatedValue","openOutputPicker","nativeBrowser","supportsOutputSwitcher","getOutput","onOutputChanged","exports","NativeUpdatedValue","emitterize","cb","useOutput","useNativeUpdatedValue"],"sourceRoot":"../../../src","sources":["features/output.ts"],"mappings":";;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAIA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,gBAAgBA,CAAA,EAAS;EACvCC,qBAAa,CAACD,gBAAgB,CAAC,CAAC;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASE,sBAAsBA,CAAA,EAAY;EAChD,OAAOD,qBAAa,CAACC,sBAAsB,CAAC,CAAC;AAC/C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,SAASA,CAAA,EAAuB;EAC9C,OAAOF,qBAAa,CAACE,SAAS,CAAC,CAAC;AAClC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMC,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAGE,sCAAkB,CAACC,UAAU,CACzDC,EAAE,IAAMP,qBAAa,CAACG,eAAe,GAAGI,EAC3C,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACO,SAASC,SAASA,CAAA,EAAuB;EAC9C,OAAO,IAAAC,4CAAqB,EAACP,SAAS,EAAEC,eAAe,CAAC;AAC1D","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_native","require","_NativeUpdatedValue","_useNativeUpdatedValue","openOutputPicker","nativeBrowser","supportsOutputSwitcher","getOutput","onOutputChanged","exports","NativeUpdatedValue","emitterize","cb","useOutput","useNativeUpdatedValue"],"sourceRoot":"../../../src","sources":["features/output.ts"],"mappings":";;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAIA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,gBAAgBA,CAAA,EAAS;EACvCC,qBAAa,CAACD,gBAAgB,CAAC,CAAC;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASE,sBAAsBA,CAAA,EAAY;EAChD,OAAOD,qBAAa,CAACC,sBAAsB,CAAC,CAAC;AAC/C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,SAASA,CAAA,EAAuB;EAC9C,OAAOF,qBAAa,CAACE,SAAS,CAAC,CAAC;AAClC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMC,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAGE,sCAAkB,CAACC,UAAU,CACzDC,EAAE,IAAMP,qBAAa,CAACG,eAAe,GAAGI,EAC3C,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACO,SAASC,SAASA,CAAA,EAAuB;EAC9C,OAAO,IAAAC,4CAAqB,EAACP,SAAS,EAAEC,eAAe,CAAC;AAC1D","ignoreList":[]}
|
|
@@ -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;;AAyBA;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;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;;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;;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;;AA2GA;;AA4CA;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;;AAyBA;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;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;;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;;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;;AA2GA;;AA4CA;AACA;AACA;AACA;AACA;;AAoCA;;AAEA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;;AAuFA;;AAMA;AACA,SAASE,iBAAiBA,CACxBC,KAAuC,EACjB;EACtB,IAAI,OAAOA,KAAK,KAAK,UAAU,EAA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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":[]}
|
|
@@ -32,8 +32,9 @@ export function supportsOutputSwitcher() {
|
|
|
32
32
|
/**
|
|
33
33
|
* The current audio output, or `undefined` when unknown. iOS reports one while a
|
|
34
34
|
* session is active; Android reports the active output route via AudioManager
|
|
35
|
-
* (the `type` is coarse — e.g. wired headphones may report as `speaker`)
|
|
36
|
-
*
|
|
35
|
+
* (the `type` is coarse — e.g. wired headphones may report as `speaker`), or the
|
|
36
|
+
* remote output selected in the Output Switcher when `remoteOutputs` is on.
|
|
37
|
+
* Guard for `undefined`.
|
|
37
38
|
*/
|
|
38
39
|
export function getOutput() {
|
|
39
40
|
return nativeBrowser.getOutput();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["nativeBrowser","NativeUpdatedValue","useNativeUpdatedValue","openOutputPicker","supportsOutputSwitcher","getOutput","onOutputChanged","emitterize","cb","useOutput"],"sourceRoot":"../../../src","sources":["features/output.ts"],"mappings":";;AACA,SAASA,aAAa,QAAQ,WAAW;AACzC,SAASC,kBAAkB,QAAQ,6BAA6B;AAChE,SAASC,qBAAqB,QAAQ,gCAAgC;AAItE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAA,EAAS;EACvCH,aAAa,CAACG,gBAAgB,CAAC,CAAC;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAAA,EAAY;EAChD,OAAOJ,aAAa,CAACI,sBAAsB,CAAC,CAAC;AAC/C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAAA,EAAuB;EAC9C,OAAOL,aAAa,CAACK,SAAS,CAAC,CAAC;AAClC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAGL,kBAAkB,CAACM,UAAU,CACzDC,EAAE,IAAMR,aAAa,CAACM,eAAe,GAAGE,EAC3C,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAAA,EAAuB;EAC9C,OAAOP,qBAAqB,CAACG,SAAS,EAAEC,eAAe,CAAC;AAC1D","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["nativeBrowser","NativeUpdatedValue","useNativeUpdatedValue","openOutputPicker","supportsOutputSwitcher","getOutput","onOutputChanged","emitterize","cb","useOutput"],"sourceRoot":"../../../src","sources":["features/output.ts"],"mappings":";;AACA,SAASA,aAAa,QAAQ,WAAW;AACzC,SAASC,kBAAkB,QAAQ,6BAA6B;AAChE,SAASC,qBAAqB,QAAQ,gCAAgC;AAItE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAA,EAAS;EACvCH,aAAa,CAACG,gBAAgB,CAAC,CAAC;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAAA,EAAY;EAChD,OAAOJ,aAAa,CAACI,sBAAsB,CAAC,CAAC;AAC/C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAAA,EAAuB;EAC9C,OAAOL,aAAa,CAACK,SAAS,CAAC,CAAC;AAClC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAGL,kBAAkB,CAACM,UAAU,CACzDC,EAAE,IAAMR,aAAa,CAACM,eAAe,GAAGE,EAC3C,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAAA,EAAuB;EAC9C,OAAOP,qBAAqB,CAACG,SAAS,EAAEC,eAAe,CAAC;AAC1D","ignoreList":[]}
|
|
@@ -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;;AAyBA;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;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;;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;;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;;AA2GA;;AA4CA;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;;AAyBA;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;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;;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;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,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":[]}
|
|
@@ -20,8 +20,9 @@ export declare function supportsOutputSwitcher(): boolean;
|
|
|
20
20
|
/**
|
|
21
21
|
* The current audio output, or `undefined` when unknown. iOS reports one while a
|
|
22
22
|
* session is active; Android reports the active output route via AudioManager
|
|
23
|
-
* (the `type` is coarse — e.g. wired headphones may report as `speaker`)
|
|
24
|
-
*
|
|
23
|
+
* (the `type` is coarse — e.g. wired headphones may report as `speaker`), or the
|
|
24
|
+
* remote output selected in the Output Switcher when `remoteOutputs` is on.
|
|
25
|
+
* Guard for `undefined`.
|
|
25
26
|
*/
|
|
26
27
|
export declare function getOutput(): Output | undefined;
|
|
27
28
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../../src/features/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAGhE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,CAAA;AAIlC;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAID
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../../src/features/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAGhE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,CAAA;AAIlC;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAID;;;;;;GAMG;AACH,wBAAgB,SAAS,IAAI,MAAM,GAAG,SAAS,CAE9C;AAID;;;;GAIG;AACH,eAAO,MAAM,eAAe,4BAE3B,CAAA;AAID;;;GAGG;AACH,wBAAgB,SAAS,IAAI,MAAM,GAAG,SAAS,CAE9C"}
|
|
@@ -466,6 +466,18 @@ export type SetupPlayerOptions = Pick<UpdateOptions, 'capabilities' | 'forwardJu
|
|
|
466
466
|
* @default true
|
|
467
467
|
*/
|
|
468
468
|
keepSessionAliveOnError?: boolean;
|
|
469
|
+
/**
|
|
470
|
+
* Offers remote speakers and TVs in the system Output Switcher (`openOutputPicker`), and
|
|
471
|
+
* reports the selected one as the `Output`, with `type: 'remote'`. Only the selection is
|
|
472
|
+
* reported: the library keeps playing locally, and rendering the audio on the speaker is the
|
|
473
|
+
* provider's job. The speakers come from media route providers that declare the library's
|
|
474
|
+
* remote-output control category (`RemoteOutputs.CATEGORY` on Android). The app declares
|
|
475
|
+
* AndroidX's `MediaTransferReceiver` in its manifest for the switcher to move the session.
|
|
476
|
+
*
|
|
477
|
+
* Android 11+ only for now; ignored on iOS, whose route picker already lists AirPlay devices.
|
|
478
|
+
* @default false
|
|
479
|
+
*/
|
|
480
|
+
remoteOutputs?: boolean;
|
|
469
481
|
/** Android-specific options: engine construction and runtime, merged. */
|
|
470
482
|
android?: AndroidSetupOptions;
|
|
471
483
|
/** iOS-specific options: audio session and runtime, merged. */
|
|
@@ -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,E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OAAO,CAAA;IAEvB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,UAAU,CAAA;IAEvB;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,WAAW,CAAA;IAE7B;;;;;;;;;;OAUG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAA;IAEjC;;;;;;;;;;OAUG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB,yEAAyE;IACzE,OAAO,CAAC,EAAE,mBAAmB,CAAA;IAC7B,+DAA+D;IAC/D,GAAG,CAAC,EAAE,eAAe,CAAA;IACrB;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,wBAAwB,CAAA;CAChD,CAAA;AAiED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAsB,WAAW,CAC/B,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CA2Df"}
|
|
@@ -11,11 +11,10 @@ export type EqualizerSettings = {
|
|
|
11
11
|
/**
|
|
12
12
|
* Cross-platform audio output kind. Each platform maps its native ports into
|
|
13
13
|
* this shared set: iOS's granular Bluetooth ports (`bluetoothA2DP`/`HFP`/`LE`)
|
|
14
|
-
* all collapse to `'bluetooth'`.
|
|
15
|
-
*
|
|
16
|
-
* reserved for remote destinations and don't appear from Android reads.
|
|
14
|
+
* all collapse to `'bluetooth'`. `'airplay'` comes from iOS only, `'remote'`
|
|
15
|
+
* from Android only (with `remoteOutputs` on), and `'cast'` is reserved.
|
|
17
16
|
*/
|
|
18
|
-
export type OutputType = 'speaker' | 'receiver' | 'headphones' | 'bluetooth' | 'airplay' | 'car' | 'hdmi' | 'usb' | 'cast' | 'other';
|
|
17
|
+
export type OutputType = 'speaker' | 'receiver' | 'headphones' | 'bluetooth' | 'airplay' | 'car' | 'hdmi' | 'usb' | 'cast' | 'remote' | 'other';
|
|
19
18
|
/**
|
|
20
19
|
* The current audio output. Read via `getOutput()` / `useOutput()` on every
|
|
21
20
|
* platform: iOS always reports one while a session is active; Android reports the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audio-browser.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/audio-browser.nitro.ts"],"names":[],"mappings":"AAyDA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,qBAAqB,EAAE,MAAM,EAAE,CAAA;IAC/B,OAAO,EAAE,OAAO,CAAA;IAChB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,mBAAmB,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED
|
|
1
|
+
{"version":3,"file":"audio-browser.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/audio-browser.nitro.ts"],"names":[],"mappings":"AAyDA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,qBAAqB,EAAE,MAAM,EAAE,CAAA;IAC/B,OAAO,EAAE,OAAO,CAAA;IAChB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,mBAAmB,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,UAAU,GACV,YAAY,GACZ,WAAW,GACX,SAAS,GACT,KAAK,GACL,MAAM,GACN,KAAK,GACL,MAAM,GACN,QAAQ,GACR,OAAO,CAAA;AAEX;;;;;;GAMG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,sBAAsB;IACtB,IAAI,EAAE,UAAU,CAAA;IAChB,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAA;IACZ,+EAA+E;IAC/E,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA"}
|
|
@@ -137,6 +137,8 @@ namespace margelo::nitro::audiobrowser {
|
|
|
137
137
|
jni::local_ref<JVariant_Boolean_RetryConfig> retry = this->getFieldValue(fieldRetry);
|
|
138
138
|
static const auto fieldKeepSessionAliveOnError = clazz->getField<jni::JBoolean>("keepSessionAliveOnError");
|
|
139
139
|
jni::local_ref<jni::JBoolean> keepSessionAliveOnError = this->getFieldValue(fieldKeepSessionAliveOnError);
|
|
140
|
+
static const auto fieldRemoteOutputs = clazz->getField<jni::JBoolean>("remoteOutputs");
|
|
141
|
+
jni::local_ref<jni::JBoolean> remoteOutputs = this->getFieldValue(fieldRemoteOutputs);
|
|
140
142
|
return NativeSetupPlayerOptions(
|
|
141
143
|
android != nullptr ? std::make_optional(android->toCpp()) : std::nullopt,
|
|
142
144
|
ios != nullptr ? std::make_optional(ios->toCpp()) : std::nullopt,
|
|
@@ -154,7 +156,8 @@ namespace margelo::nitro::audiobrowser {
|
|
|
154
156
|
playWhenReady != nullptr ? std::make_optional(static_cast<bool>(playWhenReady->value())) : std::nullopt,
|
|
155
157
|
repeatMode != nullptr ? std::make_optional(repeatMode->toCpp()) : std::nullopt,
|
|
156
158
|
retry != nullptr ? std::make_optional(retry->toCpp()) : std::nullopt,
|
|
157
|
-
keepSessionAliveOnError != nullptr ? std::make_optional(static_cast<bool>(keepSessionAliveOnError->value())) : std::nullopt
|
|
159
|
+
keepSessionAliveOnError != nullptr ? std::make_optional(static_cast<bool>(keepSessionAliveOnError->value())) : std::nullopt,
|
|
160
|
+
remoteOutputs != nullptr ? std::make_optional(static_cast<bool>(remoteOutputs->value())) : std::nullopt
|
|
158
161
|
);
|
|
159
162
|
}
|
|
160
163
|
|
|
@@ -164,7 +167,7 @@ namespace margelo::nitro::audiobrowser {
|
|
|
164
167
|
*/
|
|
165
168
|
[[maybe_unused]]
|
|
166
169
|
static jni::local_ref<JNativeSetupPlayerOptions::javaobject> fromCpp(const NativeSetupPlayerOptions& value) {
|
|
167
|
-
using JSignature = JNativeSetupPlayerOptions(jni::alias_ref<JNativeAndroidSetupOptions>, jni::alias_ref<JNativeIOSSetupOptions>, jni::alias_ref<JNativeUpdateOptions>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<JFunc_std__shared_ptr_Promise_std__optional_NowPlayingUpdate____FormatNowPlayingParams::javaobject>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<JRepeatMode>, jni::alias_ref<JVariant_Boolean_RetryConfig>, jni::alias_ref<jni::JBoolean>);
|
|
170
|
+
using JSignature = JNativeSetupPlayerOptions(jni::alias_ref<JNativeAndroidSetupOptions>, jni::alias_ref<JNativeIOSSetupOptions>, jni::alias_ref<JNativeUpdateOptions>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<JFunc_std__shared_ptr_Promise_std__optional_NowPlayingUpdate____FormatNowPlayingParams::javaobject>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<JRepeatMode>, jni::alias_ref<JVariant_Boolean_RetryConfig>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>);
|
|
168
171
|
static const auto clazz = javaClassStatic();
|
|
169
172
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
170
173
|
return create(
|
|
@@ -177,7 +180,8 @@ namespace margelo::nitro::audiobrowser {
|
|
|
177
180
|
value.playWhenReady.has_value() ? jni::JBoolean::valueOf(value.playWhenReady.value()) : nullptr,
|
|
178
181
|
value.repeatMode.has_value() ? JRepeatMode::fromCpp(value.repeatMode.value()) : nullptr,
|
|
179
182
|
value.retry.has_value() ? JVariant_Boolean_RetryConfig::fromCpp(value.retry.value()) : nullptr,
|
|
180
|
-
value.keepSessionAliveOnError.has_value() ? jni::JBoolean::valueOf(value.keepSessionAliveOnError.value()) : nullptr
|
|
183
|
+
value.keepSessionAliveOnError.has_value() ? jni::JBoolean::valueOf(value.keepSessionAliveOnError.value()) : nullptr,
|
|
184
|
+
value.remoteOutputs.has_value() ? jni::JBoolean::valueOf(value.remoteOutputs.value()) : nullptr
|
|
181
185
|
);
|
|
182
186
|
}
|
|
183
187
|
};
|
|
@@ -69,6 +69,9 @@ namespace margelo::nitro::audiobrowser {
|
|
|
69
69
|
case OutputType::CAST:
|
|
70
70
|
static const auto fieldCAST = clazz->getStaticField<JOutputType>("CAST");
|
|
71
71
|
return clazz->getStaticFieldValue(fieldCAST);
|
|
72
|
+
case OutputType::REMOTE:
|
|
73
|
+
static const auto fieldREMOTE = clazz->getStaticField<JOutputType>("REMOTE");
|
|
74
|
+
return clazz->getStaticFieldValue(fieldREMOTE);
|
|
72
75
|
case OutputType::OTHER:
|
|
73
76
|
static const auto fieldOTHER = clazz->getStaticField<JOutputType>("OTHER");
|
|
74
77
|
return clazz->getStaticFieldValue(fieldOTHER);
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/NativeSetupPlayerOptions.kt
CHANGED
|
@@ -44,13 +44,16 @@ data class NativeSetupPlayerOptions(
|
|
|
44
44
|
val retry: Variant_Boolean_RetryConfig?,
|
|
45
45
|
@DoNotStrip
|
|
46
46
|
@Keep
|
|
47
|
-
val keepSessionAliveOnError: Boolean
|
|
47
|
+
val keepSessionAliveOnError: Boolean?,
|
|
48
|
+
@DoNotStrip
|
|
49
|
+
@Keep
|
|
50
|
+
val remoteOutputs: Boolean?
|
|
48
51
|
) {
|
|
49
52
|
/**
|
|
50
53
|
* Create a new instance of NativeSetupPlayerOptions from Kotlin
|
|
51
54
|
*/
|
|
52
|
-
constructor(android: NativeAndroidSetupOptions?, ios: NativeIOSSetupOptions?, options: NativeUpdateOptions?, autoUpdateNowPlayingMetadata: Boolean?, nowPlayingMetadataFormatter: ((params: FormatNowPlayingParams) -> Promise<NowPlayingUpdate?>)?, playWhenReady: Boolean?, repeatMode: RepeatMode?, retry: Variant_Boolean_RetryConfig?, keepSessionAliveOnError: Boolean?):
|
|
53
|
-
this(android, ios, options, autoUpdateNowPlayingMetadata, nowPlayingMetadataFormatter?.let { Func_std__shared_ptr_Promise_std__optional_NowPlayingUpdate____FormatNowPlayingParams_java(it) }, playWhenReady, repeatMode, retry, keepSessionAliveOnError)
|
|
55
|
+
constructor(android: NativeAndroidSetupOptions?, ios: NativeIOSSetupOptions?, options: NativeUpdateOptions?, autoUpdateNowPlayingMetadata: Boolean?, nowPlayingMetadataFormatter: ((params: FormatNowPlayingParams) -> Promise<NowPlayingUpdate?>)?, playWhenReady: Boolean?, repeatMode: RepeatMode?, retry: Variant_Boolean_RetryConfig?, keepSessionAliveOnError: Boolean?, remoteOutputs: Boolean?):
|
|
56
|
+
this(android, ios, options, autoUpdateNowPlayingMetadata, nowPlayingMetadataFormatter?.let { Func_std__shared_ptr_Promise_std__optional_NowPlayingUpdate____FormatNowPlayingParams_java(it) }, playWhenReady, repeatMode, retry, keepSessionAliveOnError, remoteOutputs)
|
|
54
57
|
|
|
55
58
|
override fun equals(other: Any?): Boolean {
|
|
56
59
|
if (this === other) return true
|
|
@@ -64,6 +67,7 @@ data class NativeSetupPlayerOptions(
|
|
|
64
67
|
&& Objects.deepEquals(this.repeatMode, other.repeatMode)
|
|
65
68
|
&& Objects.deepEquals(this.retry, other.retry)
|
|
66
69
|
&& Objects.deepEquals(this.keepSessionAliveOnError, other.keepSessionAliveOnError)
|
|
70
|
+
&& Objects.deepEquals(this.remoteOutputs, other.remoteOutputs)
|
|
67
71
|
}
|
|
68
72
|
|
|
69
73
|
override fun hashCode(): Int {
|
|
@@ -76,7 +80,8 @@ data class NativeSetupPlayerOptions(
|
|
|
76
80
|
playWhenReady,
|
|
77
81
|
repeatMode,
|
|
78
82
|
retry,
|
|
79
|
-
keepSessionAliveOnError
|
|
83
|
+
keepSessionAliveOnError,
|
|
84
|
+
remoteOutputs
|
|
80
85
|
).contentDeepHashCode()
|
|
81
86
|
}
|
|
82
87
|
|
|
@@ -88,8 +93,8 @@ data class NativeSetupPlayerOptions(
|
|
|
88
93
|
@Keep
|
|
89
94
|
@Suppress("unused")
|
|
90
95
|
@JvmStatic
|
|
91
|
-
private fun fromCpp(android: NativeAndroidSetupOptions?, ios: NativeIOSSetupOptions?, options: NativeUpdateOptions?, autoUpdateNowPlayingMetadata: Boolean?, nowPlayingMetadataFormatter: Func_std__shared_ptr_Promise_std__optional_NowPlayingUpdate____FormatNowPlayingParams?, playWhenReady: Boolean?, repeatMode: RepeatMode?, retry: Variant_Boolean_RetryConfig?, keepSessionAliveOnError: Boolean?): NativeSetupPlayerOptions {
|
|
92
|
-
return NativeSetupPlayerOptions(android, ios, options, autoUpdateNowPlayingMetadata, nowPlayingMetadataFormatter, playWhenReady, repeatMode, retry, keepSessionAliveOnError)
|
|
96
|
+
private fun fromCpp(android: NativeAndroidSetupOptions?, ios: NativeIOSSetupOptions?, options: NativeUpdateOptions?, autoUpdateNowPlayingMetadata: Boolean?, nowPlayingMetadataFormatter: Func_std__shared_ptr_Promise_std__optional_NowPlayingUpdate____FormatNowPlayingParams?, playWhenReady: Boolean?, repeatMode: RepeatMode?, retry: Variant_Boolean_RetryConfig?, keepSessionAliveOnError: Boolean?, remoteOutputs: Boolean?): NativeSetupPlayerOptions {
|
|
97
|
+
return NativeSetupPlayerOptions(android, ios, options, autoUpdateNowPlayingMetadata, nowPlayingMetadataFormatter, playWhenReady, repeatMode, retry, keepSessionAliveOnError, remoteOutputs)
|
|
93
98
|
}
|
|
94
99
|
}
|
|
95
100
|
}
|
|
@@ -18,7 +18,7 @@ public extension NativeSetupPlayerOptions {
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `NativeSetupPlayerOptions`.
|
|
20
20
|
*/
|
|
21
|
-
init(android: NativeAndroidSetupOptions?, ios: NativeIOSSetupOptions?, options: NativeUpdateOptions?, autoUpdateNowPlayingMetadata: Bool?, nowPlayingMetadataFormatter: ((_ params: FormatNowPlayingParams) -> Promise<NowPlayingUpdate?>)?, playWhenReady: Bool?, repeatMode: RepeatMode?, retry: Variant_Bool_RetryConfig?, keepSessionAliveOnError: Bool?) {
|
|
21
|
+
init(android: NativeAndroidSetupOptions?, ios: NativeIOSSetupOptions?, options: NativeUpdateOptions?, autoUpdateNowPlayingMetadata: Bool?, nowPlayingMetadataFormatter: ((_ params: FormatNowPlayingParams) -> Promise<NowPlayingUpdate?>)?, playWhenReady: Bool?, repeatMode: RepeatMode?, retry: Variant_Bool_RetryConfig?, keepSessionAliveOnError: Bool?, remoteOutputs: Bool?) {
|
|
22
22
|
self.init({ () -> bridge.std__optional_NativeAndroidSetupOptions_ in
|
|
23
23
|
if let __unwrappedValue = android {
|
|
24
24
|
return bridge.create_std__optional_NativeAndroidSetupOptions_(__unwrappedValue)
|
|
@@ -83,6 +83,12 @@ public extension NativeSetupPlayerOptions {
|
|
|
83
83
|
} else {
|
|
84
84
|
return .init()
|
|
85
85
|
}
|
|
86
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
87
|
+
if let __unwrappedValue = remoteOutputs {
|
|
88
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
89
|
+
} else {
|
|
90
|
+
return .init()
|
|
91
|
+
}
|
|
86
92
|
}())
|
|
87
93
|
}
|
|
88
94
|
|
|
@@ -203,4 +209,16 @@ public extension NativeSetupPlayerOptions {
|
|
|
203
209
|
}
|
|
204
210
|
}()
|
|
205
211
|
}
|
|
212
|
+
|
|
213
|
+
@inline(__always)
|
|
214
|
+
var remoteOutputs: Bool? {
|
|
215
|
+
return { () -> Bool? in
|
|
216
|
+
if bridge.has_value_std__optional_bool_(self.__remoteOutputs) {
|
|
217
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__remoteOutputs)
|
|
218
|
+
return __unwrapped
|
|
219
|
+
} else {
|
|
220
|
+
return nil
|
|
221
|
+
}
|
|
222
|
+
}()
|
|
223
|
+
}
|
|
206
224
|
}
|
|
@@ -35,6 +35,8 @@ public extension OutputType {
|
|
|
35
35
|
self = .usb
|
|
36
36
|
case "cast":
|
|
37
37
|
self = .cast
|
|
38
|
+
case "remote":
|
|
39
|
+
self = .remote
|
|
38
40
|
case "other":
|
|
39
41
|
self = .other
|
|
40
42
|
default:
|
|
@@ -65,6 +67,8 @@ public extension OutputType {
|
|
|
65
67
|
return "usb"
|
|
66
68
|
case .cast:
|
|
67
69
|
return "cast"
|
|
70
|
+
case .remote:
|
|
71
|
+
return "remote"
|
|
68
72
|
case .other:
|
|
69
73
|
return "other"
|
|
70
74
|
}
|
|
@@ -71,10 +71,11 @@ namespace margelo::nitro::audiobrowser {
|
|
|
71
71
|
std::optional<RepeatMode> repeatMode SWIFT_PRIVATE;
|
|
72
72
|
std::optional<std::variant<bool, RetryConfig>> retry SWIFT_PRIVATE;
|
|
73
73
|
std::optional<bool> keepSessionAliveOnError SWIFT_PRIVATE;
|
|
74
|
+
std::optional<bool> remoteOutputs SWIFT_PRIVATE;
|
|
74
75
|
|
|
75
76
|
public:
|
|
76
77
|
NativeSetupPlayerOptions() = default;
|
|
77
|
-
explicit NativeSetupPlayerOptions(std::optional<NativeAndroidSetupOptions> android, std::optional<NativeIOSSetupOptions> ios, std::optional<NativeUpdateOptions> options, std::optional<bool> autoUpdateNowPlayingMetadata, std::optional<std::function<std::shared_ptr<Promise<std::optional<NowPlayingUpdate>>>(const FormatNowPlayingParams& /* params */)>> nowPlayingMetadataFormatter, std::optional<bool> playWhenReady, std::optional<RepeatMode> repeatMode, std::optional<std::variant<bool, RetryConfig>> retry, std::optional<bool> keepSessionAliveOnError): android(android), ios(ios), options(options), autoUpdateNowPlayingMetadata(autoUpdateNowPlayingMetadata), nowPlayingMetadataFormatter(nowPlayingMetadataFormatter), playWhenReady(playWhenReady), repeatMode(repeatMode), retry(retry), keepSessionAliveOnError(keepSessionAliveOnError) {}
|
|
78
|
+
explicit NativeSetupPlayerOptions(std::optional<NativeAndroidSetupOptions> android, std::optional<NativeIOSSetupOptions> ios, std::optional<NativeUpdateOptions> options, std::optional<bool> autoUpdateNowPlayingMetadata, std::optional<std::function<std::shared_ptr<Promise<std::optional<NowPlayingUpdate>>>(const FormatNowPlayingParams& /* params */)>> nowPlayingMetadataFormatter, std::optional<bool> playWhenReady, std::optional<RepeatMode> repeatMode, std::optional<std::variant<bool, RetryConfig>> retry, std::optional<bool> keepSessionAliveOnError, std::optional<bool> remoteOutputs): android(android), ios(ios), options(options), autoUpdateNowPlayingMetadata(autoUpdateNowPlayingMetadata), nowPlayingMetadataFormatter(nowPlayingMetadataFormatter), playWhenReady(playWhenReady), repeatMode(repeatMode), retry(retry), keepSessionAliveOnError(keepSessionAliveOnError), remoteOutputs(remoteOutputs) {}
|
|
78
79
|
|
|
79
80
|
public:
|
|
80
81
|
// NativeSetupPlayerOptions is not equatable because these properties are not equatable: nowPlayingMetadataFormatter
|
|
@@ -98,7 +99,8 @@ namespace margelo::nitro {
|
|
|
98
99
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "playWhenReady"))),
|
|
99
100
|
JSIConverter<std::optional<margelo::nitro::audiobrowser::RepeatMode>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "repeatMode"))),
|
|
100
101
|
JSIConverter<std::optional<std::variant<bool, margelo::nitro::audiobrowser::RetryConfig>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "retry"))),
|
|
101
|
-
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "keepSessionAliveOnError")))
|
|
102
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "keepSessionAliveOnError"))),
|
|
103
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "remoteOutputs")))
|
|
102
104
|
);
|
|
103
105
|
}
|
|
104
106
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::audiobrowser::NativeSetupPlayerOptions& arg) {
|
|
@@ -112,6 +114,7 @@ namespace margelo::nitro {
|
|
|
112
114
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "repeatMode"), JSIConverter<std::optional<margelo::nitro::audiobrowser::RepeatMode>>::toJSI(runtime, arg.repeatMode));
|
|
113
115
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "retry"), JSIConverter<std::optional<std::variant<bool, margelo::nitro::audiobrowser::RetryConfig>>>::toJSI(runtime, arg.retry));
|
|
114
116
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "keepSessionAliveOnError"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.keepSessionAliveOnError));
|
|
117
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "remoteOutputs"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.remoteOutputs));
|
|
115
118
|
return obj;
|
|
116
119
|
}
|
|
117
120
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -131,6 +134,7 @@ namespace margelo::nitro {
|
|
|
131
134
|
if (!JSIConverter<std::optional<margelo::nitro::audiobrowser::RepeatMode>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "repeatMode")))) return false;
|
|
132
135
|
if (!JSIConverter<std::optional<std::variant<bool, margelo::nitro::audiobrowser::RetryConfig>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "retry")))) return false;
|
|
133
136
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "keepSessionAliveOnError")))) return false;
|
|
137
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "remoteOutputs")))) return false;
|
|
134
138
|
return true;
|
|
135
139
|
}
|
|
136
140
|
};
|
|
@@ -38,7 +38,8 @@ namespace margelo::nitro::audiobrowser {
|
|
|
38
38
|
HDMI SWIFT_NAME(hdmi) = 6,
|
|
39
39
|
USB SWIFT_NAME(usb) = 7,
|
|
40
40
|
CAST SWIFT_NAME(cast) = 8,
|
|
41
|
-
|
|
41
|
+
REMOTE SWIFT_NAME(remote) = 9,
|
|
42
|
+
OTHER SWIFT_NAME(other) = 10,
|
|
42
43
|
} CLOSED_ENUM;
|
|
43
44
|
|
|
44
45
|
} // namespace margelo::nitro::audiobrowser
|
|
@@ -60,6 +61,7 @@ namespace margelo::nitro {
|
|
|
60
61
|
case hashString("hdmi"): return margelo::nitro::audiobrowser::OutputType::HDMI;
|
|
61
62
|
case hashString("usb"): return margelo::nitro::audiobrowser::OutputType::USB;
|
|
62
63
|
case hashString("cast"): return margelo::nitro::audiobrowser::OutputType::CAST;
|
|
64
|
+
case hashString("remote"): return margelo::nitro::audiobrowser::OutputType::REMOTE;
|
|
63
65
|
case hashString("other"): return margelo::nitro::audiobrowser::OutputType::OTHER;
|
|
64
66
|
default: [[unlikely]]
|
|
65
67
|
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum OutputType - invalid value!");
|
|
@@ -76,6 +78,7 @@ namespace margelo::nitro {
|
|
|
76
78
|
case margelo::nitro::audiobrowser::OutputType::HDMI: return JSIConverter<std::string>::toJSI(runtime, "hdmi");
|
|
77
79
|
case margelo::nitro::audiobrowser::OutputType::USB: return JSIConverter<std::string>::toJSI(runtime, "usb");
|
|
78
80
|
case margelo::nitro::audiobrowser::OutputType::CAST: return JSIConverter<std::string>::toJSI(runtime, "cast");
|
|
81
|
+
case margelo::nitro::audiobrowser::OutputType::REMOTE: return JSIConverter<std::string>::toJSI(runtime, "remote");
|
|
79
82
|
case margelo::nitro::audiobrowser::OutputType::OTHER: return JSIConverter<std::string>::toJSI(runtime, "other");
|
|
80
83
|
default: [[unlikely]]
|
|
81
84
|
throw std::invalid_argument("Cannot convert OutputType to JS - invalid value: "
|
|
@@ -97,6 +100,7 @@ namespace margelo::nitro {
|
|
|
97
100
|
case hashString("hdmi"):
|
|
98
101
|
case hashString("usb"):
|
|
99
102
|
case hashString("cast"):
|
|
103
|
+
case hashString("remote"):
|
|
100
104
|
case hashString("other"):
|
|
101
105
|
return true;
|
|
102
106
|
default:
|
package/package.json
CHANGED
package/src/features/output.ts
CHANGED
|
@@ -34,8 +34,9 @@ export function supportsOutputSwitcher(): boolean {
|
|
|
34
34
|
/**
|
|
35
35
|
* The current audio output, or `undefined` when unknown. iOS reports one while a
|
|
36
36
|
* session is active; Android reports the active output route via AudioManager
|
|
37
|
-
* (the `type` is coarse — e.g. wired headphones may report as `speaker`)
|
|
38
|
-
*
|
|
37
|
+
* (the `type` is coarse — e.g. wired headphones may report as `speaker`), or the
|
|
38
|
+
* remote output selected in the Output Switcher when `remoteOutputs` is on.
|
|
39
|
+
* Guard for `undefined`.
|
|
39
40
|
*/
|
|
40
41
|
export function getOutput(): Output | undefined {
|
|
41
42
|
return nativeBrowser.getOutput()
|
|
@@ -490,7 +490,11 @@ export interface IOSSetupOptions extends IOSUpdateOptions {
|
|
|
490
490
|
*/
|
|
491
491
|
export interface NativeSetupPlayerOptions extends Pick<
|
|
492
492
|
SetupPlayerOptions,
|
|
493
|
-
|
|
493
|
+
| 'playWhenReady'
|
|
494
|
+
| 'repeatMode'
|
|
495
|
+
| 'retry'
|
|
496
|
+
| 'keepSessionAliveOnError'
|
|
497
|
+
| 'remoteOutputs'
|
|
494
498
|
> {
|
|
495
499
|
/** Android-specific configuration options for setup */
|
|
496
500
|
android?: NativeAndroidSetupOptions
|
|
@@ -600,6 +604,19 @@ export type SetupPlayerOptions = Pick<
|
|
|
600
604
|
*/
|
|
601
605
|
keepSessionAliveOnError?: boolean
|
|
602
606
|
|
|
607
|
+
/**
|
|
608
|
+
* Offers remote speakers and TVs in the system Output Switcher (`openOutputPicker`), and
|
|
609
|
+
* reports the selected one as the `Output`, with `type: 'remote'`. Only the selection is
|
|
610
|
+
* reported: the library keeps playing locally, and rendering the audio on the speaker is the
|
|
611
|
+
* provider's job. The speakers come from media route providers that declare the library's
|
|
612
|
+
* remote-output control category (`RemoteOutputs.CATEGORY` on Android). The app declares
|
|
613
|
+
* AndroidX's `MediaTransferReceiver` in its manifest for the switcher to move the session.
|
|
614
|
+
*
|
|
615
|
+
* Android 11+ only for now; ignored on iOS, whose route picker already lists AirPlay devices.
|
|
616
|
+
* @default false
|
|
617
|
+
*/
|
|
618
|
+
remoteOutputs?: boolean
|
|
619
|
+
|
|
603
620
|
/** Android-specific options: engine construction and runtime, merged. */
|
|
604
621
|
android?: AndroidSetupOptions
|
|
605
622
|
/** iOS-specific options: audio session and runtime, merged. */
|
|
@@ -69,9 +69,8 @@ export type EqualizerSettings = {
|
|
|
69
69
|
/**
|
|
70
70
|
* Cross-platform audio output kind. Each platform maps its native ports into
|
|
71
71
|
* this shared set: iOS's granular Bluetooth ports (`bluetoothA2DP`/`HFP`/`LE`)
|
|
72
|
-
* all collapse to `'bluetooth'`.
|
|
73
|
-
*
|
|
74
|
-
* reserved for remote destinations and don't appear from Android reads.
|
|
72
|
+
* all collapse to `'bluetooth'`. `'airplay'` comes from iOS only, `'remote'`
|
|
73
|
+
* from Android only (with `remoteOutputs` on), and `'cast'` is reserved.
|
|
75
74
|
*/
|
|
76
75
|
export type OutputType =
|
|
77
76
|
| 'speaker' // built-in loudspeaker
|
|
@@ -82,7 +81,8 @@ export type OutputType =
|
|
|
82
81
|
| 'car' // car audio (CarPlay / Android Auto / car Bluetooth)
|
|
83
82
|
| 'hdmi'
|
|
84
83
|
| 'usb'
|
|
85
|
-
| 'cast' //
|
|
84
|
+
| 'cast' // Cast device (reserved)
|
|
85
|
+
| 'remote' // a media route provider's speaker or TV, selected in the Output Switcher (Android)
|
|
86
86
|
| 'other'
|
|
87
87
|
|
|
88
88
|
/**
|
|
@@ -51,19 +51,42 @@ An [`Output`](/api/features/output/#output) is:
|
|
|
51
51
|
| `external` | `boolean` | `false` only for the built-in speaker/receiver; `true` for everything external. |
|
|
52
52
|
|
|
53
53
|
`type` is one of `'speaker'`, `'receiver'` (the iOS earpiece), `'headphones'`,
|
|
54
|
-
`'bluetooth'`, `'airplay'`, `'car'`, `'hdmi'`, `'usb'`, `'cast'` (
|
|
55
|
-
speaker
|
|
54
|
+
`'bluetooth'`, `'airplay'`, `'car'`, `'hdmi'`, `'usb'`, `'cast'` (reserved),
|
|
55
|
+
`'remote'` (a remote speaker or TV, see below), or `'other'`. Both platforms map their native ports/routes into
|
|
56
56
|
this shared set — e.g. iOS's separate Bluetooth ports all collapse to
|
|
57
57
|
`'bluetooth'`.
|
|
58
58
|
|
|
59
59
|
::: warning Android reports a coarser type
|
|
60
60
|
On Android the type comes from the system route and is coarser: wired headphones
|
|
61
61
|
often report as `'speaker'` (the built-in route), and really only `'bluetooth'`
|
|
62
|
-
is reliably distinguished from it
|
|
63
|
-
which the reader doesn't run, so it won't appear here). The device **name** still
|
|
64
|
-
comes through.
|
|
62
|
+
is reliably distinguished from it. The device **name** still comes through.
|
|
65
63
|
:::
|
|
66
64
|
|
|
65
|
+
### Remote outputs (Android)
|
|
66
|
+
|
|
67
|
+
With `remoteOutputs: true` in [`setupPlayer`](/guide/configuration), the system
|
|
68
|
+
Output Switcher (Android 11+) also lists the speakers and TVs of media route
|
|
69
|
+
providers, and the one the listener selects becomes the output, with
|
|
70
|
+
`type: 'remote'`. While one is selected, the switcher offers **Stop casting**
|
|
71
|
+
rather than the phone's own outputs; stopping reports the local device again.
|
|
72
|
+
|
|
73
|
+
The switcher moves the session only for an app that declares AndroidX's
|
|
74
|
+
`MediaTransferReceiver` in its own manifest. The library leaves it out, because
|
|
75
|
+
it turns on transfer for any MediaRouter in the app, Cast's included:
|
|
76
|
+
|
|
77
|
+
```xml
|
|
78
|
+
<!-- android/app/src/main/AndroidManifest.xml, inside <application> -->
|
|
79
|
+
<receiver android:name="androidx.mediarouter.media.MediaTransferReceiver" />
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Without it, the switcher lists only the phone's own outputs, and the library
|
|
83
|
+
logs a warning saying the receiver is missing.
|
|
84
|
+
|
|
85
|
+
A provider offers its routes by declaring the library's control category,
|
|
86
|
+
`com.audiobrowser.RemoteOutputs.CATEGORY`, in their control filters. Only the
|
|
87
|
+
selection is reported: the library keeps playing locally, and rendering the
|
|
88
|
+
audio on the speaker is the provider's job.
|
|
89
|
+
|
|
67
90
|
Outside React, read a snapshot with `getOutput()` or subscribe with
|
|
68
91
|
[`onOutputChanged`](/api/features/output/#onoutputchanged):
|
|
69
92
|
|
|
@@ -72,7 +72,7 @@ capabilities). Elsewhere, just omit a field to leave it unchanged.
|
|
|
72
72
|
| `ios.playbackRates` / `carPlayUpNextButton` / `carPlayNowPlayingButtons` | ✓ | ✓ |
|
|
73
73
|
| `nowPlaying` (metadata formatter) | ✓ | — |
|
|
74
74
|
| `playWhenReady`, `repeatMode` (initial values) | ✓ | — |
|
|
75
|
-
| `retry`, `keepSessionAliveOnError`
|
|
75
|
+
| `retry`, `keepSessionAliveOnError`, `remoteOutputs` | ✓ | — |
|
|
76
76
|
| `android` / `ios` audio engine & session (`audioContentType`, `wakeMode`, `category`, …) | ✓ | — |
|
|
77
77
|
|
|
78
78
|
`playWhenReady` and `repeatMode` set the _initial_ state; change them at runtime
|