@poolse/react-native 2.10.1 → 2.12.0

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/dist/index.d.cts CHANGED
@@ -1153,6 +1153,22 @@ interface CallScreenProps {
1153
1153
  * {@link VoiceRoomBarProps.onStatusChange}.
1154
1154
  */
1155
1155
  onStatusChange?: (status: VoiceStatus) => void;
1156
+ /**
1157
+ * Called when the media transport changes: `'sfu'`, `'mesh'`, or
1158
+ * `null` when no call is connected.
1159
+ *
1160
+ * This decides who owns the iOS audio session, and getting it wrong is
1161
+ * silent. `@livekit/react-native`'s `registerGlobals()` configures and
1162
+ * activates AVAudioSession natively as its audio engine changes state.
1163
+ * An app that ALSO drives the session — `react-native-incall-manager`,
1164
+ * typically — fights it: the microphone publishes nothing, and audio
1165
+ * only starts working after some unrelated engine change (turning the
1166
+ * camera on) makes LiveKit reapply its configuration.
1167
+ *
1168
+ * So drive InCallManager from this, and only for `'mesh'`. The mesh
1169
+ * has no session management of its own and still needs it.
1170
+ */
1171
+ onTransportChange?: (transport: 'sfu' | 'mesh' | null) => void;
1156
1172
  /**
1157
1173
  * Called when the call's video state changes.
1158
1174
  *
@@ -1194,7 +1210,7 @@ interface CallScreenProps {
1194
1210
  * The fallback is automatic and silent by design. A deployment without
1195
1211
  * an SFU is a supported configuration, not a broken one.
1196
1212
  */
1197
- declare function CallScreen({ userId, labelFor, calls: callsProp, webrtc, livekit, livekitReactNative, onStatusChange, onVideoChange, nativeIncomingUi, }: CallScreenProps): react_jsx_runtime.JSX.Element;
1213
+ declare function CallScreen({ userId, labelFor, calls: callsProp, webrtc, livekit, livekitReactNative, onStatusChange, onTransportChange, onVideoChange, nativeIncomingUi, }: CallScreenProps): react_jsx_runtime.JSX.Element;
1198
1214
 
1199
1215
  /**
1200
1216
  * Bridges iOS PushKit + CallKit to poolse calls, and owns the incoming
package/dist/index.d.ts CHANGED
@@ -1153,6 +1153,22 @@ interface CallScreenProps {
1153
1153
  * {@link VoiceRoomBarProps.onStatusChange}.
1154
1154
  */
1155
1155
  onStatusChange?: (status: VoiceStatus) => void;
1156
+ /**
1157
+ * Called when the media transport changes: `'sfu'`, `'mesh'`, or
1158
+ * `null` when no call is connected.
1159
+ *
1160
+ * This decides who owns the iOS audio session, and getting it wrong is
1161
+ * silent. `@livekit/react-native`'s `registerGlobals()` configures and
1162
+ * activates AVAudioSession natively as its audio engine changes state.
1163
+ * An app that ALSO drives the session — `react-native-incall-manager`,
1164
+ * typically — fights it: the microphone publishes nothing, and audio
1165
+ * only starts working after some unrelated engine change (turning the
1166
+ * camera on) makes LiveKit reapply its configuration.
1167
+ *
1168
+ * So drive InCallManager from this, and only for `'mesh'`. The mesh
1169
+ * has no session management of its own and still needs it.
1170
+ */
1171
+ onTransportChange?: (transport: 'sfu' | 'mesh' | null) => void;
1156
1172
  /**
1157
1173
  * Called when the call's video state changes.
1158
1174
  *
@@ -1194,7 +1210,7 @@ interface CallScreenProps {
1194
1210
  * The fallback is automatic and silent by design. A deployment without
1195
1211
  * an SFU is a supported configuration, not a broken one.
1196
1212
  */
1197
- declare function CallScreen({ userId, labelFor, calls: callsProp, webrtc, livekit, livekitReactNative, onStatusChange, onVideoChange, nativeIncomingUi, }: CallScreenProps): react_jsx_runtime.JSX.Element;
1213
+ declare function CallScreen({ userId, labelFor, calls: callsProp, webrtc, livekit, livekitReactNative, onStatusChange, onTransportChange, onVideoChange, nativeIncomingUi, }: CallScreenProps): react_jsx_runtime.JSX.Element;
1198
1214
 
1199
1215
  /**
1200
1216
  * Bridges iOS PushKit + CallKit to poolse calls, and owns the incoming
package/dist/index.js CHANGED
@@ -5164,6 +5164,7 @@ function CallScreen({
5164
5164
  livekit,
5165
5165
  livekitReactNative,
5166
5166
  onStatusChange,
5167
+ onTransportChange,
5167
5168
  onVideoChange,
5168
5169
  nativeIncomingUi
5169
5170
  }) {
@@ -5198,6 +5199,10 @@ function CallScreen({
5198
5199
  useEffect(() => {
5199
5200
  onStatusChange?.(status);
5200
5201
  }, [status, onStatusChange]);
5202
+ const transport = status !== "connected" ? null : usingSfu ? "sfu" : "mesh";
5203
+ useEffect(() => {
5204
+ onTransportChange?.(transport);
5205
+ }, [transport, onTransportChange]);
5201
5206
  const videoOn = usingSfu && sfu.cameraEnabled;
5202
5207
  useEffect(() => {
5203
5208
  onVideoChange?.(videoOn);