@voltkit-rtc/react-native 0.1.6 → 0.1.8
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/CHANGELOG.md +40 -0
- package/README.md +49 -0
- package/android/src/main/java/com/voltkit/rtc/reactnative/Aec3Tuning.kt +85 -0
- package/android/src/main/java/com/voltkit/rtc/reactnative/RtcConfig.kt +37 -0
- package/android/src/main/java/com/voltkit/rtc/reactnative/VoltkitRtcInitProvider.kt +31 -0
- package/android/src/main/java/com/voltkit/rtc/reactnative/VoltkitRtcModule.kt +26 -0
- package/lib/commonjs/native.js +1 -1
- package/lib/commonjs/platform/common.js +8 -2
- package/lib/commonjs/platform/common.js.map +1 -1
- package/lib/commonjs/specs/NativeVoltkitRtc.js.map +1 -1
- package/lib/module/native.js +1 -1
- package/lib/module/platform/common.js +9 -3
- package/lib/module/platform/common.js.map +1 -1
- package/lib/module/specs/NativeVoltkitRtc.js.map +1 -1
- package/lib/typescript/commonjs/native.d.ts +1 -1
- package/lib/typescript/commonjs/platform/common.d.ts +6 -1
- package/lib/typescript/commonjs/platform/common.d.ts.map +1 -1
- package/lib/typescript/commonjs/specs/NativeVoltkitRtc.d.ts +8 -0
- package/lib/typescript/commonjs/specs/NativeVoltkitRtc.d.ts.map +1 -1
- package/lib/typescript/module/native.d.ts +1 -1
- package/lib/typescript/module/platform/common.d.ts +6 -1
- package/lib/typescript/module/platform/common.d.ts.map +1 -1
- package/lib/typescript/module/specs/NativeVoltkitRtc.d.ts +8 -0
- package/lib/typescript/module/specs/NativeVoltkitRtc.d.ts.map +1 -1
- package/package.json +1 -1
- package/plugin/build/android.d.ts +1 -0
- package/plugin/build/android.js +4 -1
- package/plugin/build/index.d.ts +2 -2
- package/plugin/build/index.js +2 -1
- package/plugin/build/options.d.ts +13 -0
- package/plugin/build/options.js +11 -0
- package/src/native.ts +1 -1
- package/src/platform/common.ts +9 -3
- package/src/specs/NativeVoltkitRtc.ts +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.8
|
|
4
|
+
|
|
5
|
+
Same peer dependencies as 0.1.7. Build the app again after upgrading: the check below runs in the native module.
|
|
6
|
+
|
|
7
|
+
- **An app that assigns `WebRTCModuleOptions.fieldTrials` in `MainApplication.onCreate` no longer loses the echo tuning
|
|
8
|
+
in silence** (the testers' E09-1). The init provider merges the loudspeaker tuning before `onCreate`, and
|
|
9
|
+
react-native-webrtc reads the field only when its module is made, after it: an assignment there replaced the merged
|
|
10
|
+
string while the provider's log said "tuned for loudspeakers", and nothing showed it. Now the provider logs "will be
|
|
11
|
+
tuned for loudspeakers unless the app replaces WebRTCModuleOptions.fieldTrials in onCreate"; the SDK's module, made
|
|
12
|
+
after `onCreate`, checks that the tuning is still in the field and, when it is not, logs one warning per process
|
|
13
|
+
(`VoltKitRtc: echo suppression: the app replaced WebRTC's field trials after the init provider merged the loudspeaker
|
|
14
|
+
tuning (WebRTCModuleOptions.fieldTrials is now "..."), so WebRTC's canceller runs with its own tuning; append to
|
|
15
|
+
WebRTCModuleOptions.fieldTrials in MainApplication.onCreate instead of assigning it`), reports it as the new native
|
|
16
|
+
constant `echoTuning` (`tuned` | `replaced` | `off`), and `getDiagnostics().userAgent` ends with `echo tuning replaced
|
|
17
|
+
by the app's field trials`. The README and the provider's comment now say that trials set in `onCreate` must be
|
|
18
|
+
appended (the one-line Kotlin and the Java), and that trials set before the provider (`attachBaseContext`) and an
|
|
19
|
+
app's own AEC3 override are kept, as before. The trials themselves are unchanged. Tests: `Aec3TuningTest` (`present`,
|
|
20
|
+
`status`), `echo-tuning.test.ts`.
|
|
21
|
+
|
|
22
|
+
## 0.1.7
|
|
23
|
+
|
|
24
|
+
2026-11-09. The echo canceller tuned for loudspeakers. Same peer dependencies as 0.1.6. Build the app again after upgrading:
|
|
25
|
+
the setting is read from the manifest when the app starts, and the version check reads this package's version.
|
|
26
|
+
|
|
27
|
+
- **WebRTC's canceller tuned for phones whose loudspeaker leaks into their own microphone** (`android.echoSuppression`
|
|
28
|
+
in the Expo plugin, meta-data `in.voltkit.rtc.ECHO_SUPPRESSION`: `"auto"`, the default, applies the tuning on phones whose
|
|
29
|
+
own canceller is Android's software one or absent, read from Android's effect descriptors, the gate Agora's SDK applies to
|
|
30
|
+
the phone's canceller; `"strong"` applies it everywhere; `"webrtc"` is 0.1.6's behaviour everywhere).
|
|
31
|
+
Measured on an OPPO CPH2477 at full loudspeaker volume, whose speaker compresses the sound and whose microphone clips: with
|
|
32
|
+
no processing the far voice came back 15 dB louder than it was sent, with the phone's own canceller 10 dB louder, with 0.1.6's
|
|
33
|
+
canceller 6 dB louder, and with this tuning 3 dB quieter (measured through the Flutter SDK; this SDK runs the same
|
|
34
|
+
AEC3 and the same tuning). Why it had let the echo through: AEC3 estimates the echo from what it plays with a path gain of 1
|
|
35
|
+
until its filter converges; on this phone the real gain was about +15 dB, so the residual looked like near-end speech and the
|
|
36
|
+
canceller went transparent. The tuning (WebRTC's `WebRTC-Aec3SuppressorTuningOverride` field trial, `Aec3Tuning.kt`) lowers
|
|
37
|
+
the suppressor's echo-to-near-end thresholds and makes its dominant-near-end detector insensitive. A phone whose canceller
|
|
38
|
+
coped before (a POCO X3 Pro) stays as good. The price: someone speaking into such a phone while the room is loud is cut more
|
|
39
|
+
often than before. The init provider adds the trial to `WebRTCModuleOptions.fieldTrials` (an app's own trials stay); it does
|
|
40
|
+
nothing while the phone's canceller is in use (`hardwareEchoCancellation: true`). Measurement:
|
|
41
|
+
`docs/implementation-progress/ECHO_LAB_2026-11-09.md`. Tests: `RtcConfigTest`, `Aec3TuningTest`, the plugin's.
|
|
42
|
+
|
|
3
43
|
## 0.1.6
|
|
4
44
|
|
|
5
45
|
2026-11-06. WebRTC's own echo canceller by default on Android. Same peer dependencies as 0.1.5. Build the app again after
|
package/README.md
CHANGED
|
@@ -1465,6 +1465,55 @@ apply it. In a React Native app without Expo, set the meta-data in
|
|
|
1465
1465
|
<meta-data android:name="in.voltkit.rtc.HW_AEC" android:value="true" />
|
|
1466
1466
|
```
|
|
1467
1467
|
|
|
1468
|
+
**Tuned for loudspeakers (0.1.7).** WebRTC's canceller, as tuned for laptops,
|
|
1469
|
+
still let the echo through on a phone whose loudspeaker leaks into its own
|
|
1470
|
+
microphone: measured on an OPPO CPH2477 at full volume, the far voice came back
|
|
1471
|
+
6 dB louder than it was sent, because the canceller underestimated the echo some
|
|
1472
|
+
thirty times and took the rest for someone speaking. From 0.1.7 the SDK hands
|
|
1473
|
+
WebRTC a tuning for such phones: on that phone the echo comes back 3 dB
|
|
1474
|
+
quieter than it was sent. The default, `android.echoSuppression: "auto"`, applies
|
|
1475
|
+
it only on phones whose own echo canceller is Android's software one or absent,
|
|
1476
|
+
which are the phones that echo (Android's effect descriptors say which; the gate
|
|
1477
|
+
Agora's SDK applies to the phone's canceller); phones with a vendor's canceller
|
|
1478
|
+
keep WebRTC's own tuning and full duplex. The price on the tuned phones is that
|
|
1479
|
+
someone speaking into them while the room is loud is cut more often. `"strong"`
|
|
1480
|
+
applies the tuning everywhere; `"webrtc"` keeps WebRTC's own tuning everywhere,
|
|
1481
|
+
as 0.1.6 had. Set it in the plugin's options
|
|
1482
|
+
(`{ "android": { "echoSuppression": "webrtc" } }`), or the meta-data
|
|
1483
|
+
`in.voltkit.rtc.ECHO_SUPPRESSION` without Expo, and build again. The tuning is WebRTC's `WebRTC-Aec3SuppressorTuningOverride` field
|
|
1484
|
+
trial, which the SDK's startup provider merges into `WebRTCModuleOptions.fieldTrials`
|
|
1485
|
+
before `MainApplication.onCreate` runs; it does nothing while the phone's own
|
|
1486
|
+
canceller is in use. The measurement: docs/implementation-progress/ECHO_LAB_2026-11-09.md.
|
|
1487
|
+
|
|
1488
|
+
**Field trials of your own.** They stay beside the tuning when they are set
|
|
1489
|
+
before the provider runs (in `attachBaseContext`) or **appended** in
|
|
1490
|
+
`MainApplication.onCreate`:
|
|
1491
|
+
|
|
1492
|
+
```kotlin
|
|
1493
|
+
// MainApplication.onCreate, Kotlin
|
|
1494
|
+
WebRTCModuleOptions.getInstance().apply { fieldTrials = (fieldTrials ?: "") + "WebRTC-MyTrial/Enabled/" }
|
|
1495
|
+
```
|
|
1496
|
+
|
|
1497
|
+
```java
|
|
1498
|
+
// MainApplication.onCreate, Java
|
|
1499
|
+
WebRTCModuleOptions options = WebRTCModuleOptions.getInstance();
|
|
1500
|
+
options.fieldTrials = (options.fieldTrials == null ? "" : options.fieldTrials) + "WebRTC-MyTrial/Enabled/";
|
|
1501
|
+
```
|
|
1502
|
+
|
|
1503
|
+
Assigning the field there (`fieldTrials = "WebRTC-MyTrial/Enabled/"`) replaces
|
|
1504
|
+
the tuning: react-native-webrtc reads the field only when its module is made,
|
|
1505
|
+
after `onCreate`, so WebRTC gets your trials and the canceller runs with its
|
|
1506
|
+
own tuning. From 0.1.8 the SDK's native module checks when it starts and logs
|
|
1507
|
+
one warning (`VoltKitRtc: echo suppression: the app replaced WebRTC's field
|
|
1508
|
+
trials after the init provider merged the loudspeaker tuning ...; append to
|
|
1509
|
+
WebRTCModuleOptions.fieldTrials in MainApplication.onCreate instead of assigning
|
|
1510
|
+
it`), its constant `echoTuning` reads `"replaced"` (`"tuned"` while the tuning
|
|
1511
|
+
is in, `"off"` where the SDK did not apply it: the phone's own canceller in use,
|
|
1512
|
+
`"webrtc"`, or `"auto"` on a phone with a vendor's canceller), and
|
|
1513
|
+
`getDiagnostics().userAgent` ends with `echo tuning replaced by the app's field
|
|
1514
|
+
trials`. An AEC3 tuning of your own (a `WebRTC-Aec3SuppressorTuningOverride`
|
|
1515
|
+
trial) is kept and counts as tuned.
|
|
1516
|
+
|
|
1468
1517
|
An Expo app uses the plugin option, not a hand edit: `expo prebuild` writes the
|
|
1469
1518
|
manifest again, and the edit is lost. Test either choice on the phone that
|
|
1470
1519
|
echoed and on another before you ship it. A headset or the earpiece on the
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
package com.voltkit.rtc.reactnative
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The WebRTC field trial behind the SDK's echo suppression (0.1.7): AEC3's suppressor thresholds and its dominant-
|
|
5
|
+
* near-end detector, in WebRTC's override format (`WebRTC-Aec3SuppressorTuningOverride`). AEC3 estimates the echo from
|
|
6
|
+
* what it plays with an assumed path gain of 1 until its filter converges; on the measured phone (an OPPO CPH2477,
|
|
7
|
+
* whose loudspeaker compresses the sound and whose microphone clips) the real gain was about +15 dB, so the echo was
|
|
8
|
+
* underestimated some thirty times, the residual looked like near-end speech and the canceller went transparent: the
|
|
9
|
+
* people on the other phones heard themselves, louder than they had spoken. These thresholds are WebRTC's defaults
|
|
10
|
+
* divided by that factor, and the near-end detector made as much less sensitive. From the lab of 2026-11-09
|
|
11
|
+
* (docs/implementation-progress/ECHO_LAB_2026-11-09.md). The same string is used by the Flutter and Kotlin SDKs.
|
|
12
|
+
* react-native-webrtc hands `WebRTCModuleOptions.fieldTrials` to WebRTC when it starts: it reads the field when its
|
|
13
|
+
* WebRTCModule is made, after MainApplication.onCreate, so what counts is the field's value then, not what the init
|
|
14
|
+
* provider merged before onCreate ([present], [status]; E09-1).
|
|
15
|
+
*/
|
|
16
|
+
internal object Aec3Tuning {
|
|
17
|
+
/** The trial's name with its separator: what [merge] looks for, and what must still be in the field when WebRTC starts. */
|
|
18
|
+
const val OVERRIDE: String = "WebRTC-Aec3SuppressorTuningOverride/"
|
|
19
|
+
|
|
20
|
+
const val LOUDSPEAKER: String = OVERRIDE +
|
|
21
|
+
"normal_tuning_mask_lf_enr_transparent:0.01,normal_tuning_mask_lf_enr_suppress:0.013," +
|
|
22
|
+
"normal_tuning_mask_hf_enr_transparent:0.0023,normal_tuning_mask_hf_enr_suppress:0.0033," +
|
|
23
|
+
"nearend_tuning_mask_lf_enr_transparent:0.03,nearend_tuning_mask_lf_enr_suppress:0.04," +
|
|
24
|
+
"nearend_tuning_mask_hf_enr_transparent:0.003,nearend_tuning_mask_hf_enr_suppress:0.01," +
|
|
25
|
+
"dominant_nearend_detection_enr_threshold:0.008,dominant_nearend_detection_hold_duration:25/"
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The phone's own echo canceller as Android describes it (`AudioEffect.queryEffects()`): a vendor's DSP canceller
|
|
29
|
+
* (Qualcomm Fluence, Samsung, ...) or the AOSP software one (`libaudiopreprocessing`, the old WebRTC mobile canceller
|
|
30
|
+
* run by the audio server), which the phones that echo on the loudspeaker ship (the OPPO CPH2477 of the 2026-11-09
|
|
31
|
+
* lab: MediaTek's build, uuid 9f35ed76-...; the stock one is bb392ec0-...). Agora's SDK gates the phone's canceller
|
|
32
|
+
* on the same descriptor.
|
|
33
|
+
*/
|
|
34
|
+
data class PhoneCanceller(val available: Boolean, val implementor: String?, val uuid: String?) {
|
|
35
|
+
val aosp: Boolean
|
|
36
|
+
get() = (implementor?.contains("Android Open Source") == true) ||
|
|
37
|
+
uuid.equals("bb392ec0-8d4d-11e0-a896-0002a5d5c51b", ignoreCase = true) ||
|
|
38
|
+
uuid.equals("9f35ed76-0b66-4330-8f79-e39ca266dc7c", ignoreCase = true)
|
|
39
|
+
|
|
40
|
+
fun describe(): String = if (!available) "none" else "${implementor ?: "unknown"} ($uuid)"
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
fun phoneCanceller(): PhoneCanceller {
|
|
44
|
+
val available = runCatching { android.media.audiofx.AcousticEchoCanceler.isAvailable() }.getOrDefault(false)
|
|
45
|
+
val d = runCatching {
|
|
46
|
+
android.media.audiofx.AudioEffect.queryEffects().firstOrNull { it.type == android.media.audiofx.AudioEffect.EFFECT_TYPE_AEC }
|
|
47
|
+
}.getOrNull()
|
|
48
|
+
return PhoneCanceller(available, d?.implementor, d?.uuid?.toString())
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Whether the loudspeaker tuning goes in: `strong` always, `webrtc` never, `auto` on the phones that echo (the AOSP software canceller, or none). */
|
|
52
|
+
fun tunes(suppression: EchoSuppression, phone: PhoneCanceller): Boolean = when (suppression) {
|
|
53
|
+
EchoSuppression.strong -> true
|
|
54
|
+
EchoSuppression.webrtc -> false
|
|
55
|
+
EchoSuppression.auto -> !phone.available || phone.aosp
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** [LOUDSPEAKER] added to field trials the app already set, once; an app's own AEC3 tuning stays. */
|
|
59
|
+
fun merge(existing: String?): String {
|
|
60
|
+
val have = existing?.trim().orEmpty()
|
|
61
|
+
if (present(have)) return have
|
|
62
|
+
if (have.isEmpty()) return LOUDSPEAKER
|
|
63
|
+
return (if (have.endsWith("/")) have else "$have/") + LOUDSPEAKER
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Whether [trials] carry an AEC3 suppressor override: the SDK's [LOUDSPEAKER], or an app's own (which [merge] keeps). */
|
|
67
|
+
fun present(trials: String?): Boolean = trials?.contains(OVERRIDE) == true
|
|
68
|
+
|
|
69
|
+
/** The values of the native constant `echoTuning` ([status]). */
|
|
70
|
+
const val TUNED: String = "tuned"
|
|
71
|
+
const val REPLACED: String = "replaced"
|
|
72
|
+
const val OFF: String = "off"
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The tuning's state once MainApplication.onCreate has run, asked by the SDK's module when it starts (after onCreate,
|
|
76
|
+
* as react-native-webrtc's is): [OFF] when the provider did not merge it ([tunes] said no, or it did not run); [TUNED]
|
|
77
|
+
* while [trials], WebRTCModuleOptions.fieldTrials now, still carry it (set before the provider, or appended to in
|
|
78
|
+
* onCreate); [REPLACED] when the app assigned the field in onCreate instead, which dropped the tuning (E09-1).
|
|
79
|
+
*/
|
|
80
|
+
fun status(merged: Boolean, trials: String?): String = when {
|
|
81
|
+
!merged -> OFF
|
|
82
|
+
present(trials) -> TUNED
|
|
83
|
+
else -> REPLACED
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -20,6 +20,29 @@ internal enum class AudioMode {
|
|
|
20
20
|
media,
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* How hard WebRTC's own echo canceller (AEC3) suppresses what is left of the echo (meta-data in.voltkit.rtc.ECHO_SUPPRESSION;
|
|
25
|
+
* 0.1.7). In force only while WebRTC's canceller is in use (HW_AEC false, the default): with the phone's own, WebRTC's is off.
|
|
26
|
+
*/
|
|
27
|
+
@Suppress("EnumEntryName")
|
|
28
|
+
internal enum class EchoSuppression {
|
|
29
|
+
/**
|
|
30
|
+
* The default: [strong] on phones whose own echo canceller is Android's software one or absent (the phones that echo
|
|
31
|
+
* on the loudspeaker), [webrtc] on phones with a vendor's DSP canceller (which do not echo and keep full duplex).
|
|
32
|
+
*/
|
|
33
|
+
auto,
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* AEC3 tuned for phones whose loudspeaker leaks into their own microphone (an OPPO CPH2477 returned the far voice
|
|
37
|
+
* louder than it arrived, and WebRTC's canceller as tuned for laptops mistook that echo for someone speaking and let
|
|
38
|
+
* it through). Someone speaking into the phone while the room is loud is cut more often than with [webrtc].
|
|
39
|
+
*/
|
|
40
|
+
strong,
|
|
41
|
+
|
|
42
|
+
/** WebRTC's own tuning, as 0.1.6 used. */
|
|
43
|
+
webrtc,
|
|
44
|
+
}
|
|
45
|
+
|
|
23
46
|
/**
|
|
24
47
|
* The process-wide settings the init provider reads from the app's manifest before react-native-webrtc starts
|
|
25
48
|
* (plan §5.3), as the Expo config plugin writes them or a hand-written manifest gives them:
|
|
@@ -31,6 +54,11 @@ internal enum class AudioMode {
|
|
|
31
54
|
* WebRTC's own (AEC3)
|
|
32
55
|
* <meta-data android:name="in.voltkit.rtc.SCREEN_SHARE" android:value="false" /> react-native-webrtc's
|
|
33
56
|
* screen-share service
|
|
57
|
+
* <meta-data android:name="in.voltkit.rtc.ECHO_SUPPRESSION" android:value="auto" /> auto (the default from 0.1.7:
|
|
58
|
+
* AEC3 tuned for loudspeakers
|
|
59
|
+
* on phones whose own canceller
|
|
60
|
+
* is Android's software one) |
|
|
61
|
+
* strong | webrtc
|
|
34
62
|
*
|
|
35
63
|
* Parsing only, so it can be tested off a device. A value that cannot be read keeps its default and is reported.
|
|
36
64
|
*/
|
|
@@ -38,6 +66,7 @@ internal data class RtcConfig(
|
|
|
38
66
|
val audioMode: AudioMode = AudioMode.communication,
|
|
39
67
|
val hardwareEchoCancellation: Boolean = false,
|
|
40
68
|
val screenShare: Boolean = false,
|
|
69
|
+
val echoSuppression: EchoSuppression = EchoSuppression.auto,
|
|
41
70
|
/** What could not be read, with the default used instead; the init provider logs it. */
|
|
42
71
|
val problems: List<String> = emptyList(),
|
|
43
72
|
) {
|
|
@@ -45,6 +74,7 @@ internal data class RtcConfig(
|
|
|
45
74
|
const val AUDIO_MODE = "in.voltkit.rtc.AUDIO_MODE"
|
|
46
75
|
const val HW_AEC = "in.voltkit.rtc.HW_AEC"
|
|
47
76
|
const val SCREEN_SHARE = "in.voltkit.rtc.SCREEN_SHARE"
|
|
77
|
+
const val ECHO_SUPPRESSION = "in.voltkit.rtc.ECHO_SUPPRESSION"
|
|
48
78
|
|
|
49
79
|
/** From the application's meta-data: [meta] gives one key's value (a Bundle's `get`), or null. */
|
|
50
80
|
fun from(meta: (String) -> Any?): RtcConfig {
|
|
@@ -55,10 +85,17 @@ internal data class RtcConfig(
|
|
|
55
85
|
?: AudioMode.communication.also { problems += "$AUDIO_MODE: '$raw' is not communication or media; using communication" }
|
|
56
86
|
else -> AudioMode.communication.also { problems += "$AUDIO_MODE: '$raw' is not communication or media; using communication" }
|
|
57
87
|
}
|
|
88
|
+
val suppression = when (val raw = meta(ECHO_SUPPRESSION)) {
|
|
89
|
+
null -> EchoSuppression.auto
|
|
90
|
+
is String -> EchoSuppression.values().firstOrNull { it.name == raw.trim().lowercase() }
|
|
91
|
+
?: EchoSuppression.auto.also { problems += "$ECHO_SUPPRESSION: '$raw' is not auto, strong or webrtc; using auto" }
|
|
92
|
+
else -> EchoSuppression.auto.also { problems += "$ECHO_SUPPRESSION: '$raw' is not auto, strong or webrtc; using auto" }
|
|
93
|
+
}
|
|
58
94
|
return RtcConfig(
|
|
59
95
|
audioMode = mode,
|
|
60
96
|
hardwareEchoCancellation = flag(meta(HW_AEC), HW_AEC, default = false, problems),
|
|
61
97
|
screenShare = flag(meta(SCREEN_SHARE), SCREEN_SHARE, default = false, problems),
|
|
98
|
+
echoSuppression = suppression,
|
|
62
99
|
problems = problems,
|
|
63
100
|
)
|
|
64
101
|
}
|
|
@@ -30,6 +30,15 @@ import java.util.concurrent.CopyOnWriteArraySet
|
|
|
30
30
|
* (MainApplication runs after providers): the audio mode and echo cancellation are then the app's, and the constant
|
|
31
31
|
* audioDeviceModule is false. selectAudioInput keeps working when the app's module is a JavaAudioDeviceModule; with any
|
|
32
32
|
* other module, or none, it answers false.
|
|
33
|
+
*
|
|
34
|
+
* The same order governs the field trials (0.1.7): this provider merges the loudspeaker tuning into
|
|
35
|
+
* WebRTCModuleOptions.fieldTrials, and react-native-webrtc reads that field only when its WebRTCModule is made, after
|
|
36
|
+
* MainApplication.onCreate. Trials the app sets before the provider runs (attachBaseContext) are merged with. An app that
|
|
37
|
+
* sets trials of its own in onCreate must APPEND to the field, in Kotlin
|
|
38
|
+
* `WebRTCModuleOptions.getInstance().apply { fieldTrials = (fieldTrials ?: "") + "WebRTC-MyTrial/Enabled/" }`;
|
|
39
|
+
* assigning it there replaces the tuning, and the log below cannot know yet. So the log says "will be tuned", and
|
|
40
|
+
* [VoltkitRtcModule], made after onCreate, checks whether the tuning is still there ([Aec3Tuning.status]), warns once
|
|
41
|
+
* when it is not and reports it as the constant `echoTuning` (E09-1).
|
|
33
42
|
*/
|
|
34
43
|
class VoltkitRtcInitProvider : ContentProvider() {
|
|
35
44
|
override fun onCreate(): Boolean {
|
|
@@ -49,6 +58,19 @@ class VoltkitRtcInitProvider : ContentProvider() {
|
|
|
49
58
|
config.problems.forEach { Log.w(TAG, "manifest meta-data: $it") }
|
|
50
59
|
val options = WebRTCModuleOptions.getInstance()
|
|
51
60
|
if (config.screenShare) options.enableMediaProjectionService = true
|
|
61
|
+
// WebRTC's canceller tuned for loudspeakers (0.1.7): a field trial react-native-webrtc hands WebRTC when it
|
|
62
|
+
// starts, read when the canceller is built. Nothing to tune while the phone's own canceller is in use (WebRTC's
|
|
63
|
+
// is then off). Field trials the app set before this provider stay; this one is added. Whether it survives
|
|
64
|
+
// MainApplication.onCreate (an app that assigns the field there drops it) is VoltkitRtcModule's check.
|
|
65
|
+
if (!config.hardwareEchoCancellation) {
|
|
66
|
+
val phone = Aec3Tuning.phoneCanceller()
|
|
67
|
+
val tune = Aec3Tuning.tunes(config.echoSuppression, phone)
|
|
68
|
+
if (tune) {
|
|
69
|
+
options.fieldTrials = Aec3Tuning.merge(options.fieldTrials)
|
|
70
|
+
echoTuningMerged = true
|
|
71
|
+
}
|
|
72
|
+
Log.i(TAG, "echo suppression ${config.echoSuppression.name}: the phone's canceller is ${phone.describe()}; WebRTC's canceller ${if (tune) "will be tuned for loudspeakers unless the app replaces WebRTCModuleOptions.fieldTrials in onCreate" else "with its own tuning"}")
|
|
73
|
+
}
|
|
52
74
|
if (options.audioDeviceModule != null) {
|
|
53
75
|
Log.i(TAG, "react-native-webrtc already has an audio device module; keeping it")
|
|
54
76
|
return
|
|
@@ -82,6 +104,15 @@ class VoltkitRtcInitProvider : ContentProvider() {
|
|
|
82
104
|
var audioDeviceModule: JavaAudioDeviceModule? = null
|
|
83
105
|
private set
|
|
84
106
|
|
|
107
|
+
/**
|
|
108
|
+
* Whether this provider merged the loudspeaker tuning into WebRTCModuleOptions.fieldTrials. Whether it is still
|
|
109
|
+
* there when WebRTC starts is [VoltkitRtcModule]'s check ([Aec3Tuning.status]): an app that assigns the field in
|
|
110
|
+
* MainApplication.onCreate, instead of appending to it, replaces it (E09-1).
|
|
111
|
+
*/
|
|
112
|
+
@Volatile
|
|
113
|
+
var echoTuningMerged: Boolean = false
|
|
114
|
+
private set
|
|
115
|
+
|
|
85
116
|
/** Microphone failures the audio device module reports, for every client to report (mic-interrupted). */
|
|
86
117
|
val microphoneErrors = CopyOnWriteArraySet<(String) -> Unit>()
|
|
87
118
|
|
|
@@ -7,6 +7,7 @@ import android.content.pm.PackageManager
|
|
|
7
7
|
import android.os.Build
|
|
8
8
|
import android.os.Handler
|
|
9
9
|
import android.os.Looper
|
|
10
|
+
import android.util.Log
|
|
10
11
|
import androidx.core.content.ContextCompat
|
|
11
12
|
import com.facebook.react.bridge.Arguments
|
|
12
13
|
import com.facebook.react.bridge.Promise
|
|
@@ -34,6 +35,25 @@ class VoltkitRtcModule(reactContext: ReactApplicationContext) : NativeVoltkitRtc
|
|
|
34
35
|
private val config = VoltkitRtcInitProvider.configOf(app)
|
|
35
36
|
private val main = Handler(Looper.getMainLooper())
|
|
36
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Whether the loudspeaker tuning the init provider merged (0.1.7) is still in WebRTCModuleOptions.fieldTrials now
|
|
40
|
+
* that MainApplication.onCreate has run: this module, like react-native-webrtc's, is made after it, and
|
|
41
|
+
* react-native-webrtc reads the field only then. An app that assigned the field in onCreate instead of appending to
|
|
42
|
+
* it shows here as `replaced` (E09-1): one warning per process, and the constant `echoTuning` for the JavaScript.
|
|
43
|
+
*/
|
|
44
|
+
private val echoTuning: String = WebRTCModuleOptions.getInstance().fieldTrials.let { trials ->
|
|
45
|
+
Aec3Tuning.status(VoltkitRtcInitProvider.echoTuningMerged, trials).also { status ->
|
|
46
|
+
if (status == Aec3Tuning.REPLACED && echoTuningWarned.compareAndSet(false, true)) {
|
|
47
|
+
Log.w(
|
|
48
|
+
TAG,
|
|
49
|
+
"echo suppression: the app replaced WebRTC's field trials after the init provider merged the loudspeaker tuning " +
|
|
50
|
+
"(WebRTCModuleOptions.fieldTrials is now \"${trials.orEmpty()}\"), so WebRTC's canceller runs with its own tuning; " +
|
|
51
|
+
"append to WebRTCModuleOptions.fieldTrials in MainApplication.onCreate instead of assigning it",
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
37
57
|
// --- audio ---------------------------------------------------------------------------------------------------
|
|
38
58
|
private val router: AudioRouter by lazy { AudioRouter.get(app, config.audioMode).also { it.addListener(audioListener) } }
|
|
39
59
|
private val holders = HashMap<Int, Any>()
|
|
@@ -101,6 +121,8 @@ class VoltkitRtcModule(reactContext: ReactApplicationContext) : NativeVoltkitRtc
|
|
|
101
121
|
"audioDeviceModule" to VoltkitRtcInitProvider.audioDeviceModule.let {
|
|
102
122
|
it != null && it === WebRTCModuleOptions.getInstance().audioDeviceModule
|
|
103
123
|
},
|
|
124
|
+
// tuned | replaced | off: the loudspeaker tuning as this module found it after MainApplication.onCreate (E09-1).
|
|
125
|
+
"echoTuning" to echoTuning,
|
|
104
126
|
)
|
|
105
127
|
}
|
|
106
128
|
|
|
@@ -296,10 +318,14 @@ class VoltkitRtcModule(reactContext: ReactApplicationContext) : NativeVoltkitRtc
|
|
|
296
318
|
|
|
297
319
|
companion object {
|
|
298
320
|
const val NAME = NativeVoltkitRtcSpec.NAME
|
|
321
|
+
private const val TAG = "VoltKitRtc"
|
|
299
322
|
|
|
300
323
|
/** Rejections use the VoltKit error registry's codes. */
|
|
301
324
|
private const val E_MEDIA = "media-unavailable"
|
|
302
325
|
|
|
326
|
+
/** The E09-1 warning goes out once per process, not once per React instance (a reload makes a new module). */
|
|
327
|
+
private val echoTuningWarned = AtomicBoolean(false)
|
|
328
|
+
|
|
303
329
|
private val CALL_SERVICE_PERMISSIONS = listOf(
|
|
304
330
|
Manifest.permission.FOREGROUND_SERVICE,
|
|
305
331
|
Manifest.permission.RECORD_AUDIO,
|
package/lib/commonjs/native.js
CHANGED
|
@@ -21,7 +21,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
/** The version of this package: what getDiagnostics() reports, and what the native side was built from. */
|
|
24
|
-
const SDK_VERSION = exports.SDK_VERSION = '0.1.
|
|
24
|
+
const SDK_VERSION = exports.SDK_VERSION = '0.1.8';
|
|
25
25
|
|
|
26
26
|
/** The native module, or null where there is none (iOS, Expo Go, an app not rebuilt). */
|
|
27
27
|
function nativeModule() {
|
|
@@ -60,9 +60,15 @@ function localStream(client) {
|
|
|
60
60
|
return client.local ?? null;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* getDiagnostics().userAgent: `ReactNative android 37; react-native-webrtc 155.0.1; @voltkit-rtc/react-native 0.1.4`,
|
|
65
|
+
* with `; echo tuning replaced by the app's field trials` at the end when the app assigned WebRTCModuleOptions.fieldTrials
|
|
66
|
+
* in MainApplication.onCreate after the init provider had merged the loudspeaker tuning (the native constant
|
|
67
|
+
* `echoTuning`, E09-1): the one diagnostic an app or a tester reads that shows it.
|
|
68
|
+
*/
|
|
64
69
|
function describePlatform() {
|
|
65
|
-
|
|
70
|
+
const platform = `ReactNative ${_reactNative.Platform.OS} ${String(_reactNative.Platform.Version)}; react-native-webrtc ${(0, _globals.webrtcVersion)() ?? 'unknown'}; @voltkit-rtc/react-native ${_native.SDK_VERSION}`;
|
|
71
|
+
return (0, _native.nativeConstants)()?.echoTuning === 'replaced' ? `${platform}; echo tuning replaced by the app's field trials` : platform;
|
|
66
72
|
}
|
|
67
73
|
|
|
68
74
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_client","_globals","_native","_errors","_permissions","_streams","localStream","client","local","describePlatform","Platform","OS","String","Version","webrtcVersion","SDK_VERSION","deviceEnv","device","isPad","userAgent","uaMobile","maxTouchPoints","hardwareH264","supported","smooth","powerEfficient","exports","kindsOf","constraints","kinds","video","push","audio","captureUserMedia","webrtc","loadWebRTC","webrtcMissing","statuses","checkMediaPermissions","kind","status","permissionRefused","stream","mediaDevices","getUserMedia","err","name","RpcError","join","describeError","reason","book","streamBook","adopt","missing","getVideoTracks","length","getAudioTracks","tracks","getTracks","release","track","stop"],"sourceRoot":"../../../src","sources":["platform/common.ts"],"mappings":";;;;;;;;;;;AAIA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAVA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA;;AAaA;AACO,SAASO,WAAWA,CAACC,MAAmC,EAA0B;EACvF,OAAQA,MAAM,CAACC,KAAK,IAA2C,IAAI;AACrE;;AAEA;AACO,SAASC,gBAAgBA,CAAA,EAAW;EACzC,
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_client","_globals","_native","_errors","_permissions","_streams","localStream","client","local","describePlatform","platform","Platform","OS","String","Version","webrtcVersion","SDK_VERSION","nativeConstants","echoTuning","deviceEnv","device","isPad","userAgent","uaMobile","maxTouchPoints","hardwareH264","supported","smooth","powerEfficient","exports","kindsOf","constraints","kinds","video","push","audio","captureUserMedia","webrtc","loadWebRTC","webrtcMissing","statuses","checkMediaPermissions","kind","status","permissionRefused","stream","mediaDevices","getUserMedia","err","name","RpcError","join","describeError","reason","book","streamBook","adopt","missing","getVideoTracks","length","getAudioTracks","tracks","getTracks","release","track","stop"],"sourceRoot":"../../../src","sources":["platform/common.ts"],"mappings":";;;;;;;;;;;AAIA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AA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,IAAI,KAAK,QAAQ,GAAGA,IAAI,GAAG;IAAiB,CAAC,CAAC;EAC7K;EACA,MAAMK,IAAI,GAAG,IAAAC,mBAAU,EAAC,CAAC;EACzBD,IAAI,CAACE,KAAK,CAACX,MAAM,EAAE,SAAS,CAAC;EAC7B,MAAMY,OAAmC,GAAG1B,WAAW,CAACE,KAAK,IAAIY,MAAM,CAACa,cAAc,CAAC,CAAC,CAACC,MAAM,KAAK,CAAC,GACjG,QAAQ,GACR5B,WAAW,CAACI,KAAK,IAAIU,MAAM,CAACe,cAAc,CAAC,CAAC,CAACD,MAAM,KAAK,CAAC,GAAG,YAAY,GAAG,IAAI;EACnF,IAAIF,OAAO,EAAE;IACX,MAAMI,MAAM,GAAGhB,MAAM,CAACiB,SAAS,CAAC,CAAC;IACjCR,IAAI,CAACS,OAAO,CAAClB,MAAM,CAAC;IACpB,KAAK,MAAMmB,KAAK,IAAIH,MAAM,EAAEP,IAAI,CAACW,IAAI,CAACD,KAAK,CAAC;IAC5C,MAAM,IAAApB,yBAAiB,EAACa,OAAO,EAAE,QAAQ,CAAC;EAC5C;EACA,OAAOZ,MAAM;AACf","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeVoltkitRtc.ts"],"mappings":";;;;;;AAWA,IAAAA,YAAA,GAAAC,OAAA;AAXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AAcA;AAOA;AAKA;AAKA;AAKA;AAKA;AAKA;AAeA;AAQA;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeVoltkitRtc.ts"],"mappings":";;;;;;AAWA,IAAAA,YAAA,GAAAC,OAAA;AAXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AAcA;AAOA;AAKA;AAKA;AAKA;AAKA;AAKA;AAeA;AAQA;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAyGeC,gCAAmB,CAACC,GAAG,CAAO,YAAY,CAAC","ignoreList":[]}
|
package/lib/module/native.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Platform } from 'react-native';
|
|
|
9
9
|
import NativeVoltkitRtc from "./specs/NativeVoltkitRtc.js";
|
|
10
10
|
import { iosUnsupported, logError, nativeMissing } from "./errors.js";
|
|
11
11
|
/** The version of this package: what getDiagnostics() reports, and what the native side was built from. */
|
|
12
|
-
export const SDK_VERSION = '0.1.
|
|
12
|
+
export const SDK_VERSION = '0.1.8';
|
|
13
13
|
|
|
14
14
|
/** The native module, or null where there is none (iOS, Expo Go, an app not rebuilt). */
|
|
15
15
|
export function nativeModule() {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { Platform } from 'react-native';
|
|
8
8
|
import { RpcError } from '@voltkit-rtc/client';
|
|
9
9
|
import { loadWebRTC, webrtcVersion } from "../globals.js";
|
|
10
|
-
import { SDK_VERSION } from "../native.js";
|
|
10
|
+
import { nativeConstants, SDK_VERSION } from "../native.js";
|
|
11
11
|
import { describeError, permissionRefused, webrtcMissing } from "../errors.js";
|
|
12
12
|
import { checkMediaPermissions } from "../permissions.js";
|
|
13
13
|
import { streamBook } from "./streams.js";
|
|
@@ -51,9 +51,15 @@ export function localStream(client) {
|
|
|
51
51
|
return client.local ?? null;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* getDiagnostics().userAgent: `ReactNative android 37; react-native-webrtc 155.0.1; @voltkit-rtc/react-native 0.1.4`,
|
|
56
|
+
* with `; echo tuning replaced by the app's field trials` at the end when the app assigned WebRTCModuleOptions.fieldTrials
|
|
57
|
+
* in MainApplication.onCreate after the init provider had merged the loudspeaker tuning (the native constant
|
|
58
|
+
* `echoTuning`, E09-1): the one diagnostic an app or a tester reads that shows it.
|
|
59
|
+
*/
|
|
55
60
|
export function describePlatform() {
|
|
56
|
-
|
|
61
|
+
const platform = `ReactNative ${Platform.OS} ${String(Platform.Version)}; react-native-webrtc ${webrtcVersion() ?? 'unknown'}; @voltkit-rtc/react-native ${SDK_VERSION}`;
|
|
62
|
+
return nativeConstants()?.echoTuning === 'replaced' ? `${platform}; echo tuning replaced by the app's field trials` : platform;
|
|
57
63
|
}
|
|
58
64
|
|
|
59
65
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","RpcError","loadWebRTC","webrtcVersion","SDK_VERSION","describeError","permissionRefused","webrtcMissing","checkMediaPermissions","streamBook","localStream","client","local","describePlatform","OS","String","Version","deviceEnv","device","isPad","userAgent","uaMobile","maxTouchPoints","hardwareH264","supported","smooth","powerEfficient","kindsOf","constraints","kinds","video","push","audio","captureUserMedia","webrtc","statuses","kind","status","stream","mediaDevices","getUserMedia","err","name","join","reason","book","adopt","missing","getVideoTracks","length","getAudioTracks","tracks","getTracks","release","track","stop"],"sourceRoot":"../../../src","sources":["platform/common.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,QAAQ,QAAqE,qBAAqB;AAC3G,SAASC,UAAU,EAAEC,aAAa,QAAQ,eAAY;AACtD,SAASC,WAAW,QAAQ,cAAW;
|
|
1
|
+
{"version":3,"names":["Platform","RpcError","loadWebRTC","webrtcVersion","nativeConstants","SDK_VERSION","describeError","permissionRefused","webrtcMissing","checkMediaPermissions","streamBook","localStream","client","local","describePlatform","platform","OS","String","Version","echoTuning","deviceEnv","device","isPad","userAgent","uaMobile","maxTouchPoints","hardwareH264","supported","smooth","powerEfficient","kindsOf","constraints","kinds","video","push","audio","captureUserMedia","webrtc","statuses","kind","status","stream","mediaDevices","getUserMedia","err","name","join","reason","book","adopt","missing","getVideoTracks","length","getAudioTracks","tracks","getTracks","release","track","stop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A;;AAKA;;AAKA;;AAKA;;AAeA;;AAQA;;
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeVoltkitRtc.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mBAAmB,QAAQ,cAAc;;AAElD;;AAcA;;AAOA;;AAKA;;AAKA;;AAKA;;AAKA;;AAKA;;AAeA;;AAQA;;AAyGA,eAAeA,mBAAmB,CAACC,GAAG,CAAO,YAAY,CAAC","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@ import type { EventSubscription } from 'react-native';
|
|
|
2
2
|
import { type AudioDevice, type Constants, type Spec } from './specs/NativeVoltkitRtc';
|
|
3
3
|
import type { MediaDevice } from '@voltkit-rtc/client';
|
|
4
4
|
/** The version of this package: what getDiagnostics() reports, and what the native side was built from. */
|
|
5
|
-
export declare const SDK_VERSION = "0.1.
|
|
5
|
+
export declare const SDK_VERSION = "0.1.8";
|
|
6
6
|
/** The native module, or null where there is none (iOS, Expo Go, an app not rebuilt). */
|
|
7
7
|
export declare function nativeModule(): Spec | null;
|
|
8
8
|
/** The module's constants, read once: the audio mode, screen sharing, the call service as the manifest declares them. */
|
|
@@ -72,7 +72,12 @@ export interface MediaStreamLike {
|
|
|
72
72
|
export declare function localStream(client: {
|
|
73
73
|
readonly local: unknown;
|
|
74
74
|
}): MediaStreamLike | null;
|
|
75
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
* getDiagnostics().userAgent: `ReactNative android 37; react-native-webrtc 155.0.1; @voltkit-rtc/react-native 0.1.4`,
|
|
77
|
+
* with `; echo tuning replaced by the app's field trials` at the end when the app assigned WebRTCModuleOptions.fieldTrials
|
|
78
|
+
* in MainApplication.onCreate after the init provider had merged the loudspeaker tuning (the native constant
|
|
79
|
+
* `echoTuning`, E09-1): the one diagnostic an app or a tester reads that shows it.
|
|
80
|
+
*/
|
|
76
81
|
export declare function describePlatform(): string;
|
|
77
82
|
/**
|
|
78
83
|
* What the client reads to pick its defaults: a phone or tablet, so two simulcast layers and the H.264 decision
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/platform/common.ts"],"names":[],"mappings":"AAKA,OAAO,EAAY,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG5G,OAAO,EAAmD,KAAK,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAItG;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,WAAW,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9F,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC;AACtE,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAGrE;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;CAC5C;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,8BAA8B;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6BAA6B;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,OAAO,EAAE,OAAO,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CAAC;IACzC,cAAc,IAAI,oBAAoB,EAAE,CAAC;IACzC,QAAQ,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC5C,WAAW,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC/C,KAAK,IAAI,MAAM,CAAC;IAChB,OAAO,CAAC,aAAa,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACxC;AAED,gFAAgF;AAChF,wBAAgB,WAAW,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,eAAe,GAAG,IAAI,CAEvF;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAGzC;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,SAAS,CAGrC;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,iBAAyG,CAAC;AAErI,oDAAoD;AACpD,wBAAgB,OAAO,CAAC,WAAW,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,mBAAmB,EAAE,CAKhG;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAC,CA6B/F"}
|
|
@@ -97,6 +97,14 @@ export type Constants = {
|
|
|
97
97
|
* when that one is a JavaAudioDeviceModule) or the provider did not run.
|
|
98
98
|
*/
|
|
99
99
|
audioDeviceModule: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* The echo canceller's loudspeaker tuning (0.1.7) as the native module found it when it started, after
|
|
102
|
+
* MainApplication.onCreate: `tuned` while WebRTCModuleOptions.fieldTrials still carries it; `replaced` when the app
|
|
103
|
+
* assigned that field in onCreate instead of appending to it, so WebRTC got the app's trials without the tuning (the
|
|
104
|
+
* module logs one warning, and getDiagnostics().userAgent says so); `off` when the init provider did not merge it
|
|
105
|
+
* (hardwareEchoCancellation, echoSuppression `webrtc`, `auto` on a phone with a vendor's canceller) or did not run.
|
|
106
|
+
*/
|
|
107
|
+
echoTuning: string;
|
|
100
108
|
};
|
|
101
109
|
export interface Spec extends TurboModule {
|
|
102
110
|
getConstants(): Constants;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeVoltkitRtc.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeVoltkitRtc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG9D,6EAA6E;AAC7E,MAAM,MAAM,WAAW,GAAG;IACxB,+GAA+G;IAC/G,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,8FAA8F;IAC9F,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,sGAAsG;AACtG,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB,CAAC;AAEF,8EAA8E;AAC9E,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF,+GAA+G;AAC/G,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,qEAAqE;AACrE,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,2GAA2G;AAC3G,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,gHAAgH;AAChH,MAAM,MAAM,qBAAqB,GAA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AAC,sBAAsB,EAAE,YAAY,CAAC,YAAY,CAAC,yBAAyB,CAAC,CAAC;IACtF,QAAQ,CAAC,kBAAkB,EAAE,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;IAC9E,QAAQ,CAAC,kBAAkB,EAAE,YAAY,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;IACzE,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;CACrD;;AAED,wBAA2D"}
|
|
@@ -2,7 +2,7 @@ import type { EventSubscription } from 'react-native';
|
|
|
2
2
|
import { type AudioDevice, type Constants, type Spec } from './specs/NativeVoltkitRtc.js';
|
|
3
3
|
import type { MediaDevice } from '@voltkit-rtc/client';
|
|
4
4
|
/** The version of this package: what getDiagnostics() reports, and what the native side was built from. */
|
|
5
|
-
export declare const SDK_VERSION = "0.1.
|
|
5
|
+
export declare const SDK_VERSION = "0.1.8";
|
|
6
6
|
/** The native module, or null where there is none (iOS, Expo Go, an app not rebuilt). */
|
|
7
7
|
export declare function nativeModule(): Spec | null;
|
|
8
8
|
/** The module's constants, read once: the audio mode, screen sharing, the call service as the manifest declares them. */
|
|
@@ -72,7 +72,12 @@ export interface MediaStreamLike {
|
|
|
72
72
|
export declare function localStream(client: {
|
|
73
73
|
readonly local: unknown;
|
|
74
74
|
}): MediaStreamLike | null;
|
|
75
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
* getDiagnostics().userAgent: `ReactNative android 37; react-native-webrtc 155.0.1; @voltkit-rtc/react-native 0.1.4`,
|
|
77
|
+
* with `; echo tuning replaced by the app's field trials` at the end when the app assigned WebRTCModuleOptions.fieldTrials
|
|
78
|
+
* in MainApplication.onCreate after the init provider had merged the loudspeaker tuning (the native constant
|
|
79
|
+
* `echoTuning`, E09-1): the one diagnostic an app or a tester reads that shows it.
|
|
80
|
+
*/
|
|
76
81
|
export declare function describePlatform(): string;
|
|
77
82
|
/**
|
|
78
83
|
* What the client reads to pick its defaults: a phone or tablet, so two simulcast layers and the H.264 decision
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/platform/common.ts"],"names":[],"mappings":"AAKA,OAAO,EAAY,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG5G,OAAO,EAAmD,KAAK,mBAAmB,EAAE,MAAM,cAAW,CAAC;AAItG;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,WAAW,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9F,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC;AACtE,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAGrE;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;CAC5C;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,8BAA8B;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6BAA6B;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,IAAI,IAAI,CAAC;I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,CAAC;IACzC,QAAQ,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC5C,WAAW,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC/C,KAAK,IAAI,MAAM,CAAC;IAChB,OAAO,CAAC,aAAa,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACxC;AAED,gFAAgF;AAChF,wBAAgB,WAAW,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,eAAe,GAAG,IAAI,CAEvF;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAGzC;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,SAAS,CAGrC;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,iBAAyG,CAAC;AAErI,oDAAoD;AACpD,wBAAgB,OAAO,CAAC,WAAW,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,mBAAmB,EAAE,CAKhG;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAC,CA6B/F"}
|
|
@@ -97,6 +97,14 @@ export type Constants = {
|
|
|
97
97
|
* when that one is a JavaAudioDeviceModule) or the provider did not run.
|
|
98
98
|
*/
|
|
99
99
|
audioDeviceModule: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* The echo canceller's loudspeaker tuning (0.1.7) as the native module found it when it started, after
|
|
102
|
+
* MainApplication.onCreate: `tuned` while WebRTCModuleOptions.fieldTrials still carries it; `replaced` when the app
|
|
103
|
+
* assigned that field in onCreate instead of appending to it, so WebRTC got the app's trials without the tuning (the
|
|
104
|
+
* module logs one warning, and getDiagnostics().userAgent says so); `off` when the init provider did not merge it
|
|
105
|
+
* (hardwareEchoCancellation, echoSuppression `webrtc`, `auto` on a phone with a vendor's canceller) or did not run.
|
|
106
|
+
*/
|
|
107
|
+
echoTuning: string;
|
|
100
108
|
};
|
|
101
109
|
export interface Spec extends TurboModule {
|
|
102
110
|
getConstants(): Constants;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeVoltkitRtc.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeVoltkitRtc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG9D,6EAA6E;AAC7E,MAAM,MAAM,WAAW,GAAG;IACxB,+GAA+G;IAC/G,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,8FAA8F;IAC9F,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,sGAAsG;AACtG,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB,CAAC;AAEF,8EAA8E;AAC9E,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF,+GAA+G;AAC/G,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,qEAAqE;AACrE,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,2GAA2G;AAC3G,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,gHAAgH;AAChH,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,OAAO,CAAC;CACn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CAAC,yBAAyB,CAAC,CAAC;IACtF,QAAQ,CAAC,kBAAkB,EAAE,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;IAC9E,QAAQ,CAAC,kBAAkB,EAAE,YAAY,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;IACzE,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;CACrD;;AAED,wBAA2D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voltkit-rtc/react-native",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "React Native SDK for VoltKit RTC: calls, audio rooms and live video on Android (iOS in preview), with the hooks of @voltkit-rtc/react, background calls, audio routing and an Expo config plugin.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"voltkit",
|
|
@@ -6,6 +6,7 @@ export declare const CALL_SERVICE_CLASS = "com.voltkit.rtc.reactnative.VoltkitCa
|
|
|
6
6
|
export declare const META_AUDIO_MODE = "in.voltkit.rtc.AUDIO_MODE";
|
|
7
7
|
export declare const META_HW_AEC = "in.voltkit.rtc.HW_AEC";
|
|
8
8
|
export declare const META_SCREEN_SHARE = "in.voltkit.rtc.SCREEN_SHARE";
|
|
9
|
+
export declare const META_ECHO_SUPPRESSION = "in.voltkit.rtc.ECHO_SUPPRESSION";
|
|
9
10
|
/** A service type by its manifest name (CallServiceTypes.kt), with what it needs on Android 14 and later. */
|
|
10
11
|
type ServiceType = 'microphone' | 'mediaPlayback' | 'camera' | 'mediaProjection';
|
|
11
12
|
/** What the plugin writes for these options, given the permissions the app blocks. */
|
package/plugin/build/android.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withVoltkitAndroid = exports.META_SCREEN_SHARE = exports.META_HW_AEC = exports.META_AUDIO_MODE = exports.CALL_SERVICE_CLASS = void 0;
|
|
3
|
+
exports.withVoltkitAndroid = exports.META_ECHO_SUPPRESSION = exports.META_SCREEN_SHARE = exports.META_HW_AEC = exports.META_AUDIO_MODE = exports.CALL_SERVICE_CLASS = void 0;
|
|
4
4
|
exports.blockedPermissions = blockedPermissions;
|
|
5
5
|
exports.planAndroid = planAndroid;
|
|
6
6
|
exports.setVoltkitManifest = setVoltkitManifest;
|
|
@@ -27,6 +27,7 @@ exports.setVoltkitManifest = setVoltkitManifest;
|
|
|
27
27
|
* <meta-data android:name="in.voltkit.rtc.AUDIO_MODE" android:value="communication" /> RtcConfig.kt
|
|
28
28
|
* <meta-data android:name="in.voltkit.rtc.HW_AEC" android:value="false" />
|
|
29
29
|
* <meta-data android:name="in.voltkit.rtc.SCREEN_SHARE" android:value="false" />
|
|
30
|
+
* <meta-data android:name="in.voltkit.rtc.ECHO_SUPPRESSION" android:value="auto" /> auto | strong | webrtc (0.1.7)
|
|
30
31
|
* <service android:name="com.voltkit.rtc.reactnative.VoltkitCallService" android:exported="false"
|
|
31
32
|
* android:foregroundServiceType="microphone|mediaPlayback" /> VoltkitCallService.kt
|
|
32
33
|
* </application>
|
|
@@ -85,6 +86,7 @@ exports.CALL_SERVICE_CLASS = 'com.voltkit.rtc.reactnative.VoltkitCallService';
|
|
|
85
86
|
exports.META_AUDIO_MODE = 'in.voltkit.rtc.AUDIO_MODE';
|
|
86
87
|
exports.META_HW_AEC = 'in.voltkit.rtc.HW_AEC';
|
|
87
88
|
exports.META_SCREEN_SHARE = 'in.voltkit.rtc.SCREEN_SHARE';
|
|
89
|
+
exports.META_ECHO_SUPPRESSION = 'in.voltkit.rtc.ECHO_SUPPRESSION';
|
|
88
90
|
const permission = (name) => `android.permission.${name}`;
|
|
89
91
|
const CAMERA = permission('CAMERA');
|
|
90
92
|
const RECORD_AUDIO = permission('RECORD_AUDIO');
|
|
@@ -246,6 +248,7 @@ function setVoltkitManifest(manifest, options, configBlocked = []) {
|
|
|
246
248
|
config_plugins_1.AndroidConfig.Manifest.addMetaDataItemToMainApplication(application, exports.META_AUDIO_MODE, options.audioMode);
|
|
247
249
|
config_plugins_1.AndroidConfig.Manifest.addMetaDataItemToMainApplication(application, exports.META_HW_AEC, String(options.hardwareEchoCancellation));
|
|
248
250
|
config_plugins_1.AndroidConfig.Manifest.addMetaDataItemToMainApplication(application, exports.META_SCREEN_SHARE, String(plan.screenShare));
|
|
251
|
+
config_plugins_1.AndroidConfig.Manifest.addMetaDataItemToMainApplication(application, exports.META_ECHO_SUPPRESSION, options.echoSuppression);
|
|
249
252
|
setCallService(application, plan.serviceTypes);
|
|
250
253
|
if (plan.serviceDropped) {
|
|
251
254
|
config_plugins_1.WarningAggregator.addWarningAndroid(`${options_1.PLUGIN_NAME} android.callService`, `VoltkitCallService is not declared: ${plan.serviceDropped}. Calls will drop a few seconds after the app leaves ` +
|
package/plugin/build/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import type { ConfigPlugin } from 'expo/config-plugins';
|
|
|
2
2
|
import type { VoltkitRtcPluginProps } from './options';
|
|
3
3
|
declare const _default: ConfigPlugin<void | VoltkitRtcPluginProps | null>;
|
|
4
4
|
export default _default;
|
|
5
|
-
export { CALL_SERVICE_CLASS, META_AUDIO_MODE, META_HW_AEC, META_SCREEN_SHARE, blockedPermissions, planAndroid, setVoltkitManifest, withVoltkitAndroid, } from './android';
|
|
5
|
+
export { CALL_SERVICE_CLASS, META_AUDIO_MODE, META_ECHO_SUPPRESSION, META_HW_AEC, META_SCREEN_SHARE, blockedPermissions, planAndroid, setVoltkitManifest, withVoltkitAndroid, } from './android';
|
|
6
6
|
export type { AndroidPlan } from './android';
|
|
7
7
|
export { setVoltkitInfoPlist, withVoltkitIos } from './ios';
|
|
8
8
|
export { DEFAULT_CAMERA_PERMISSION, DEFAULT_MICROPHONE_PERMISSION, PLUGIN_NAME, resolveOptions } from './options';
|
|
9
|
-
export type { AndroidOptions, AudioMode, IosOptions, PluginOptions, VoltkitRtcAndroidProps, VoltkitRtcIosProps, VoltkitRtcPluginProps, } from './options';
|
|
9
|
+
export type { AndroidOptions, AudioMode, IosOptions, PluginOptions, VoltkitRtcAndroidProps, VoltkitRtcIosProps, VoltkitRtcPluginProps, EchoSuppression, } from './options';
|
package/plugin/build/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveOptions = exports.PLUGIN_NAME = exports.DEFAULT_MICROPHONE_PERMISSION = exports.DEFAULT_CAMERA_PERMISSION = exports.withVoltkitIos = exports.setVoltkitInfoPlist = exports.withVoltkitAndroid = exports.setVoltkitManifest = exports.planAndroid = exports.blockedPermissions = exports.META_SCREEN_SHARE = exports.META_HW_AEC = exports.META_AUDIO_MODE = exports.CALL_SERVICE_CLASS = void 0;
|
|
3
|
+
exports.resolveOptions = exports.PLUGIN_NAME = exports.DEFAULT_MICROPHONE_PERMISSION = exports.DEFAULT_CAMERA_PERMISSION = exports.withVoltkitIos = exports.setVoltkitInfoPlist = exports.withVoltkitAndroid = exports.setVoltkitManifest = exports.planAndroid = exports.blockedPermissions = exports.META_SCREEN_SHARE = exports.META_HW_AEC = exports.META_ECHO_SUPPRESSION = exports.META_AUDIO_MODE = exports.CALL_SERVICE_CLASS = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* The Expo config plugin of @voltkit-rtc/react-native (plan §5.5). An app lists it in app.json:
|
|
6
6
|
*
|
|
@@ -38,6 +38,7 @@ exports.default = (0, config_plugins_1.createRunOncePlugin)(withVoltkitRtc, opti
|
|
|
38
38
|
var android_2 = require("./android");
|
|
39
39
|
Object.defineProperty(exports, "CALL_SERVICE_CLASS", { enumerable: true, get: function () { return android_2.CALL_SERVICE_CLASS; } });
|
|
40
40
|
Object.defineProperty(exports, "META_AUDIO_MODE", { enumerable: true, get: function () { return android_2.META_AUDIO_MODE; } });
|
|
41
|
+
Object.defineProperty(exports, "META_ECHO_SUPPRESSION", { enumerable: true, get: function () { return android_2.META_ECHO_SUPPRESSION; } });
|
|
41
42
|
Object.defineProperty(exports, "META_HW_AEC", { enumerable: true, get: function () { return android_2.META_HW_AEC; } });
|
|
42
43
|
Object.defineProperty(exports, "META_SCREEN_SHARE", { enumerable: true, get: function () { return android_2.META_SCREEN_SHARE; } });
|
|
43
44
|
Object.defineProperty(exports, "blockedPermissions", { enumerable: true, get: function () { return android_2.blockedPermissions; } });
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
export declare const PLUGIN_NAME = "@voltkit-rtc/react-native";
|
|
18
18
|
/** How the app plays call audio (meta-data in.voltkit.rtc.AUDIO_MODE; RtcConfig.kt). */
|
|
19
19
|
export type AudioMode = 'communication' | 'media';
|
|
20
|
+
/** How hard WebRTC's echo canceller suppresses what is left of the echo (meta-data in.voltkit.rtc.ECHO_SUPPRESSION; RtcConfig.kt). */
|
|
21
|
+
export type EchoSuppression = 'auto' | 'strong' | 'webrtc';
|
|
20
22
|
export interface VoltkitRtcAndroidProps {
|
|
21
23
|
/**
|
|
22
24
|
* "communication" (default): call audio, echo cancellation, the earpiece, the loudspeaker and headsets. "media", for
|
|
@@ -57,6 +59,16 @@ export interface VoltkitRtcAndroidProps {
|
|
|
57
59
|
* some phones' cancellers do not cope with the loudspeaker. True for the phone's, as before 0.1.6.
|
|
58
60
|
*/
|
|
59
61
|
hardwareEchoCancellation?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* How hard WebRTC's echo canceller suppresses what is left of the echo (meta-data in.voltkit.rtc.ECHO_SUPPRESSION).
|
|
64
|
+
* "auto" (default from 0.1.7): "strong" on phones whose own canceller is Android's software one or absent, which are the
|
|
65
|
+
* phones that echo on the loudspeaker; "webrtc" on phones with a vendor's canceller. "strong": AEC3 tuned for phones
|
|
66
|
+
* whose loudspeaker leaks into their own microphone, everywhere (measured on one whose untuned canceller returned the
|
|
67
|
+
* far voice louder than it arrived; the price is that someone speaking into the phone while the room is loud is cut
|
|
68
|
+
* more often). "webrtc": WebRTC's own tuning everywhere, as 0.1.6 used. In force only with WebRTC's canceller
|
|
69
|
+
* (hardwareEchoCancellation false).
|
|
70
|
+
*/
|
|
71
|
+
echoSuppression?: EchoSuppression;
|
|
60
72
|
}
|
|
61
73
|
export interface VoltkitRtcIosProps {
|
|
62
74
|
/** Adds `audio` to UIBackgroundModes, so a call keeps its sound in the background (default true). */
|
|
@@ -79,6 +91,7 @@ export interface AndroidOptions {
|
|
|
79
91
|
callServiceCamera: boolean;
|
|
80
92
|
screenShare: boolean;
|
|
81
93
|
hardwareEchoCancellation: boolean;
|
|
94
|
+
echoSuppression: EchoSuppression;
|
|
82
95
|
}
|
|
83
96
|
export interface IosOptions {
|
|
84
97
|
/** Absent: keep the Info.plist's own text, or write the default. */
|
package/plugin/build/options.js
CHANGED
|
@@ -22,6 +22,7 @@ exports.PLUGIN_NAME = '@voltkit-rtc/react-native';
|
|
|
22
22
|
exports.DEFAULT_CAMERA_PERMISSION = 'Allow $(PRODUCT_NAME) to use your camera in calls.';
|
|
23
23
|
exports.DEFAULT_MICROPHONE_PERMISSION = 'Allow $(PRODUCT_NAME) to use your microphone in calls.';
|
|
24
24
|
const AUDIO_MODES = ['communication', 'media'];
|
|
25
|
+
const ECHO_SUPPRESSIONS = ['auto', 'strong', 'webrtc'];
|
|
25
26
|
const ANDROID_DEFAULTS = {
|
|
26
27
|
audioMode: 'communication',
|
|
27
28
|
camera: true,
|
|
@@ -29,6 +30,7 @@ const ANDROID_DEFAULTS = {
|
|
|
29
30
|
callServiceCamera: false,
|
|
30
31
|
screenShare: false,
|
|
31
32
|
hardwareEchoCancellation: false,
|
|
33
|
+
echoSuppression: 'auto',
|
|
32
34
|
};
|
|
33
35
|
const IOS_DEFAULTS = { backgroundAudio: true, voip: false };
|
|
34
36
|
const TOP_KEYS = ['cameraPermission', 'microphonePermission', 'android', 'ios'];
|
|
@@ -112,8 +114,17 @@ function resolveOptions(props) {
|
|
|
112
114
|
}
|
|
113
115
|
audioMode = value;
|
|
114
116
|
}
|
|
117
|
+
let echoSuppression = ANDROID_DEFAULTS.echoSuppression;
|
|
118
|
+
if (androidProps.echoSuppression !== undefined) {
|
|
119
|
+
const value = androidProps.echoSuppression;
|
|
120
|
+
if (!ECHO_SUPPRESSIONS.includes(value)) {
|
|
121
|
+
fail(`android.echoSuppression must be ${ECHO_SUPPRESSIONS.map((mode) => `"${mode}"`).join(' or ')}, not ${show(value)}`);
|
|
122
|
+
}
|
|
123
|
+
echoSuppression = value;
|
|
124
|
+
}
|
|
115
125
|
const android = {
|
|
116
126
|
audioMode,
|
|
127
|
+
echoSuppression,
|
|
117
128
|
camera: bool(androidProps, 'camera', 'android', ANDROID_DEFAULTS.camera),
|
|
118
129
|
callService: bool(androidProps, 'callService', 'android', ANDROID_DEFAULTS.callService),
|
|
119
130
|
callServiceCamera: bool(androidProps, 'callServiceCamera', 'android', ANDROID_DEFAULTS.callServiceCamera),
|
package/src/native.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { iosUnsupported, logError, nativeMissing } from './errors';
|
|
|
10
10
|
import type { AudioDeviceType, DeviceKind, MediaDevice } from '@voltkit-rtc/client';
|
|
11
11
|
|
|
12
12
|
/** The version of this package: what getDiagnostics() reports, and what the native side was built from. */
|
|
13
|
-
export const SDK_VERSION = '0.1.
|
|
13
|
+
export const SDK_VERSION = '0.1.8';
|
|
14
14
|
|
|
15
15
|
/** The native module, or null where there is none (iOS, Expo Go, an app not rebuilt). */
|
|
16
16
|
export function nativeModule(): Spec | null {
|
package/src/platform/common.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Platform } from 'react-native';
|
|
6
6
|
import { RpcError, type ClientPlatform, type DeviceEnv, type EncodingInfoProbe } from '@voltkit-rtc/client';
|
|
7
7
|
import { loadWebRTC, webrtcVersion } from '../globals';
|
|
8
|
-
import { SDK_VERSION } from '../native';
|
|
8
|
+
import { nativeConstants, SDK_VERSION } from '../native';
|
|
9
9
|
import { describeError, permissionRefused, webrtcMissing, type MediaPermissionKind } from '../errors';
|
|
10
10
|
import { checkMediaPermissions } from '../permissions';
|
|
11
11
|
import { streamBook, type StreamLike } from './streams';
|
|
@@ -89,9 +89,15 @@ export function localStream(client: { readonly local: unknown }): MediaStreamLik
|
|
|
89
89
|
return (client.local as MediaStreamLike | null | undefined) ?? null;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* getDiagnostics().userAgent: `ReactNative android 37; react-native-webrtc 155.0.1; @voltkit-rtc/react-native 0.1.4`,
|
|
94
|
+
* with `; echo tuning replaced by the app's field trials` at the end when the app assigned WebRTCModuleOptions.fieldTrials
|
|
95
|
+
* in MainApplication.onCreate after the init provider had merged the loudspeaker tuning (the native constant
|
|
96
|
+
* `echoTuning`, E09-1): the one diagnostic an app or a tester reads that shows it.
|
|
97
|
+
*/
|
|
93
98
|
export function describePlatform(): string {
|
|
94
|
-
|
|
99
|
+
const platform = `ReactNative ${Platform.OS} ${String(Platform.Version)}; react-native-webrtc ${webrtcVersion() ?? 'unknown'}; @voltkit-rtc/react-native ${SDK_VERSION}`;
|
|
100
|
+
return nativeConstants()?.echoTuning === 'replaced' ? `${platform}; echo tuning replaced by the app's field trials` : platform;
|
|
95
101
|
}
|
|
96
102
|
|
|
97
103
|
/**
|
|
@@ -109,6 +109,14 @@ export type Constants = {
|
|
|
109
109
|
* when that one is a JavaAudioDeviceModule) or the provider did not run.
|
|
110
110
|
*/
|
|
111
111
|
audioDeviceModule: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* The echo canceller's loudspeaker tuning (0.1.7) as the native module found it when it started, after
|
|
114
|
+
* MainApplication.onCreate: `tuned` while WebRTCModuleOptions.fieldTrials still carries it; `replaced` when the app
|
|
115
|
+
* assigned that field in onCreate instead of appending to it, so WebRTC got the app's trials without the tuning (the
|
|
116
|
+
* module logs one warning, and getDiagnostics().userAgent says so); `off` when the init provider did not merge it
|
|
117
|
+
* (hardwareEchoCancellation, echoSuppression `webrtc`, `auto` on a phone with a vendor's canceller) or did not run.
|
|
118
|
+
*/
|
|
119
|
+
echoTuning: string;
|
|
112
120
|
};
|
|
113
121
|
|
|
114
122
|
export interface Spec extends TurboModule {
|