@stream-io/video-react-native-sdk 1.29.4-beta.0 → 1.30.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/CHANGELOG.md +3162 -0
- package/android/src/main/AndroidManifest.xml +1 -8
- package/android/src/main/AndroidManifestNew.xml +0 -11
- package/android/src/main/java/com/streamvideo/reactnative/StreamVideoReactNativeModule.kt +5 -42
- package/android/src/main/java/com/streamvideo/reactnative/audio/utils/WebRtcAudioUtils.kt +6 -70
- package/android/src/main/java/com/streamvideo/reactnative/callmanager/StreamInCallManagerModule.kt +4 -6
- package/android/src/main/java/com/streamvideo/reactnative/util/CallAliveServiceChecker.kt +95 -0
- package/dist/commonjs/components/Call/CallContent/CallContent.js +13 -7
- package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js +50 -14
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js +27 -0
- package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js +19 -10
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js +12 -9
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
- package/dist/commonjs/components/Call/CallParticipantsList/CallParticipantsList.js +19 -4
- package/dist/commonjs/components/Call/CallParticipantsList/CallParticipantsList.js.map +1 -1
- package/dist/commonjs/hooks/push/index.js +2 -0
- package/dist/commonjs/hooks/push/index.js.map +1 -1
- package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js +160 -0
- package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -0
- package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +31 -18
- package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
- package/dist/commonjs/hooks/push/useProcessPushCallEffect.js +67 -0
- package/dist/commonjs/hooks/push/useProcessPushCallEffect.js.map +1 -0
- package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js +97 -64
- package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/commonjs/index.js +0 -1
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/modules/call-manager/CallManager.js +0 -26
- package/dist/commonjs/modules/call-manager/CallManager.js.map +1 -1
- package/dist/commonjs/providers/StreamCall/index.js +6 -6
- package/dist/commonjs/providers/StreamCall/index.js.map +1 -1
- package/dist/commonjs/utils/StreamVideoRN/index.js +21 -33
- package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/commonjs/utils/hooks/index.js +0 -11
- package/dist/commonjs/utils/hooks/index.js.map +1 -1
- package/dist/commonjs/utils/internal/registerSDKGlobals.js +3 -52
- package/dist/commonjs/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/commonjs/utils/push/android.js +202 -151
- package/dist/commonjs/utils/push/android.js.map +1 -1
- package/dist/commonjs/utils/push/internal/ios.js +34 -17
- package/dist/commonjs/utils/push/internal/ios.js.map +1 -1
- package/dist/commonjs/utils/push/internal/rxSubjects.js +45 -1
- package/dist/commonjs/utils/push/internal/rxSubjects.js.map +1 -1
- package/dist/commonjs/utils/push/internal/utils.js +20 -32
- package/dist/commonjs/utils/push/internal/utils.js.map +1 -1
- package/dist/commonjs/utils/push/ios.js.map +1 -1
- package/dist/commonjs/utils/push/libs/callkeep.js +17 -0
- package/dist/commonjs/utils/push/libs/callkeep.js.map +1 -0
- package/dist/commonjs/utils/push/libs/index.js +19 -8
- package/dist/commonjs/utils/push/libs/index.js.map +1 -1
- package/dist/commonjs/utils/push/libs/notifee/index.js +19 -0
- package/dist/commonjs/utils/push/libs/notifee/index.js.map +1 -1
- package/dist/commonjs/utils/push/libs/voipPushNotification.js +17 -0
- package/dist/commonjs/utils/push/libs/voipPushNotification.js.map +1 -0
- package/dist/commonjs/utils/push/setupIosCallKeepEvents.js +205 -0
- package/dist/commonjs/utils/push/setupIosCallKeepEvents.js.map +1 -0
- package/dist/commonjs/utils/push/setupIosVoipPushEvents.js +6 -7
- package/dist/commonjs/utils/push/setupIosVoipPushEvents.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/commonjs/version.js.map +1 -1
- package/dist/module/components/Call/CallContent/CallContent.js +10 -4
- package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js +52 -16
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipNative.js +27 -0
- package/dist/module/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
- package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js +19 -10
- package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
- package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js +15 -12
- package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
- package/dist/module/components/Call/CallParticipantsList/CallParticipantsList.js +20 -5
- package/dist/module/components/Call/CallParticipantsList/CallParticipantsList.js.map +1 -1
- package/dist/module/hooks/push/index.js +2 -0
- package/dist/module/hooks/push/index.js.map +1 -1
- package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js +153 -0
- package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -0
- package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +31 -18
- package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
- package/dist/module/hooks/push/useProcessPushCallEffect.js +60 -0
- package/dist/module/hooks/push/useProcessPushCallEffect.js.map +1 -0
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +99 -66
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/module/index.js +0 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/modules/call-manager/CallManager.js +0 -26
- package/dist/module/modules/call-manager/CallManager.js.map +1 -1
- package/dist/module/providers/StreamCall/index.js +6 -6
- package/dist/module/providers/StreamCall/index.js.map +1 -1
- package/dist/module/utils/StreamVideoRN/index.js +21 -33
- package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/module/utils/hooks/index.js +0 -1
- package/dist/module/utils/hooks/index.js.map +1 -1
- package/dist/module/utils/internal/registerSDKGlobals.js +3 -52
- package/dist/module/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/module/utils/push/android.js +204 -153
- package/dist/module/utils/push/android.js.map +1 -1
- package/dist/module/utils/push/internal/ios.js +34 -17
- package/dist/module/utils/push/internal/ios.js.map +1 -1
- package/dist/module/utils/push/internal/rxSubjects.js +44 -0
- package/dist/module/utils/push/internal/rxSubjects.js.map +1 -1
- package/dist/module/utils/push/internal/utils.js +19 -29
- package/dist/module/utils/push/internal/utils.js.map +1 -1
- package/dist/module/utils/push/ios.js.map +1 -1
- package/dist/module/utils/push/libs/callkeep.js +11 -0
- package/dist/module/utils/push/libs/callkeep.js.map +1 -0
- package/dist/module/utils/push/libs/index.js +2 -1
- package/dist/module/utils/push/libs/index.js.map +1 -1
- package/dist/module/utils/push/libs/notifee/index.js +18 -0
- package/dist/module/utils/push/libs/notifee/index.js.map +1 -1
- package/dist/module/utils/push/libs/voipPushNotification.js +11 -0
- package/dist/module/utils/push/libs/voipPushNotification.js.map +1 -0
- package/dist/module/utils/push/setupIosCallKeepEvents.js +199 -0
- package/dist/module/utils/push/setupIosCallKeepEvents.js.map +1 -0
- package/dist/module/utils/push/setupIosVoipPushEvents.js +6 -7
- package/dist/module/utils/push/setupIosVoipPushEvents.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/module/version.js.map +1 -1
- package/dist/typescript/components/Call/CallContent/CallContent.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipIOS.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts +18 -0
- package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallLayout/CallParticipantsGrid.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallLayout/CallParticipantsSpotlight.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallParticipantsList/CallParticipantsList.d.ts.map +1 -1
- package/dist/typescript/hooks/push/index.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts +5 -0
- package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts.map +1 -0
- package/dist/typescript/hooks/push/useIosVoipPushEventsSetupEffect.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts +8 -0
- package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts.map +1 -0
- package/dist/typescript/hooks/useAndroidKeepCallAliveEffect.d.ts.map +1 -1
- package/dist/typescript/index.d.ts +0 -1
- package/dist/typescript/index.d.ts.map +1 -1
- package/dist/typescript/modules/call-manager/CallManager.d.ts +0 -5
- package/dist/typescript/modules/call-manager/CallManager.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/index.d.ts +2 -20
- package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/types.d.ts +29 -54
- package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
- package/dist/typescript/utils/hooks/index.d.ts +0 -1
- package/dist/typescript/utils/hooks/index.d.ts.map +1 -1
- package/dist/typescript/utils/internal/registerSDKGlobals.d.ts.map +1 -1
- package/dist/typescript/utils/push/android.d.ts +2 -1
- package/dist/typescript/utils/push/android.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/ios.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/rxSubjects.d.ts +33 -0
- package/dist/typescript/utils/push/internal/rxSubjects.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/utils.d.ts +1 -8
- package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
- package/dist/typescript/utils/push/ios.d.ts +2 -1
- package/dist/typescript/utils/push/ios.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/callkeep.d.ts +3 -0
- package/dist/typescript/utils/push/libs/callkeep.d.ts.map +1 -0
- package/dist/typescript/utils/push/libs/index.d.ts +2 -1
- package/dist/typescript/utils/push/libs/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/notifee/index.d.ts +1 -0
- package/dist/typescript/utils/push/libs/notifee/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/voipPushNotification.d.ts +3 -0
- package/dist/typescript/utils/push/libs/voipPushNotification.d.ts.map +1 -0
- package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts +6 -0
- package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts.map +1 -0
- package/dist/typescript/utils/push/setupIosVoipPushEvents.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/dist/typescript/version.d.ts.map +1 -1
- package/expo-config-plugin/dist/withAndroidManifest.js +33 -1
- package/expo-config-plugin/dist/withAndroidPermissions.js +7 -2
- package/expo-config-plugin/dist/withAppDelegate.js +197 -19
- package/expo-config-plugin/dist/withMainActivity.js +1 -1
- package/expo-config-plugin/dist/withiOSInfoPlist.js +3 -2
- package/ios/PictureInPicture/PictureInPictureAvatarView.swift +273 -0
- package/ios/PictureInPicture/PictureInPictureConnectionQualityIndicator.swift +162 -0
- package/ios/PictureInPicture/PictureInPictureContent.swift +173 -0
- package/ios/PictureInPicture/PictureInPictureContentState.swift +123 -0
- package/ios/PictureInPicture/PictureInPictureDelegateProxy.swift +89 -0
- package/ios/PictureInPicture/PictureInPictureEnforcedStopAdapter.swift +166 -0
- package/ios/PictureInPicture/PictureInPictureLogger.swift +16 -0
- package/ios/PictureInPicture/PictureInPictureParticipantOverlayView.swift +217 -0
- package/ios/PictureInPicture/PictureInPictureReconnectionView.swift +193 -0
- package/ios/PictureInPicture/StreamAVPictureInPictureVideoCallViewController.swift +125 -7
- package/ios/PictureInPicture/StreamPictureInPictureController.swift +237 -63
- package/ios/PictureInPicture/StreamPictureInPictureControllerProtocol.swift +30 -0
- package/ios/PictureInPicture/StreamPictureInPictureVideoRenderer.swift +384 -12
- package/ios/RTCViewPip.swift +187 -21
- package/ios/RTCViewPipManager.mm +9 -0
- package/ios/RTCViewPipManager.swift +3 -3
- package/ios/StreamInCallManager.m +0 -2
- package/ios/StreamInCallManager.swift +7 -19
- package/ios/StreamVideoReactNative.h +4 -7
- package/ios/StreamVideoReactNative.m +82 -189
- package/package.json +19 -14
- package/src/components/Call/CallContent/CallContent.tsx +16 -8
- package/src/components/Call/CallContent/RTCViewPipIOS.tsx +81 -15
- package/src/components/Call/CallContent/RTCViewPipNative.tsx +36 -0
- package/src/components/Call/CallLayout/CallParticipantsGrid.tsx +28 -14
- package/src/components/Call/CallLayout/CallParticipantsSpotlight.tsx +19 -10
- package/src/components/Call/CallParticipantsList/CallParticipantsList.tsx +20 -5
- package/src/hooks/push/index.ts +2 -0
- package/src/hooks/push/useIosCallkeepWithCallingStateEffect.ts +235 -0
- package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +34 -21
- package/src/hooks/push/useProcessPushCallEffect.ts +108 -0
- package/src/hooks/useAndroidKeepCallAliveEffect.ts +120 -94
- package/src/index.ts +0 -1
- package/src/modules/call-manager/CallManager.ts +0 -36
- package/src/modules/call-manager/native-module.d.ts +0 -7
- package/src/providers/StreamCall/index.tsx +6 -6
- package/src/utils/StreamVideoRN/index.ts +30 -40
- package/src/utils/StreamVideoRN/types.ts +29 -56
- package/src/utils/hooks/index.ts +0 -1
- package/src/utils/internal/registerSDKGlobals.ts +4 -47
- package/src/utils/push/android.ts +309 -227
- package/src/utils/push/internal/ios.ts +44 -28
- package/src/utils/push/internal/rxSubjects.ts +61 -0
- package/src/utils/push/internal/utils.ts +26 -45
- package/src/utils/push/ios.ts +6 -1
- package/src/utils/push/libs/callkeep.ts +16 -0
- package/src/utils/push/libs/index.ts +2 -1
- package/src/utils/push/libs/notifee/index.ts +27 -0
- package/src/utils/push/libs/voipPushNotification.ts +17 -0
- package/src/utils/push/setupIosCallKeepEvents.ts +252 -0
- package/src/utils/push/setupIosVoipPushEvents.ts +7 -11
- package/src/version.ts +1 -1
- package/android/src/main/java/com/streamvideo/reactnative/keepalive/KeepAliveNotification.kt +0 -83
- package/android/src/main/java/com/streamvideo/reactnative/keepalive/StreamCallKeepAliveHeadlessService.kt +0 -149
- package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js +0 -121
- package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js.map +0 -1
- package/dist/commonjs/utils/hooks/useDebouncedValue.js +0 -24
- package/dist/commonjs/utils/hooks/useDebouncedValue.js.map +0 -1
- package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js +0 -58
- package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js.map +0 -1
- package/dist/commonjs/utils/internal/callingx/callingx.js +0 -109
- package/dist/commonjs/utils/internal/callingx/callingx.js.map +0 -1
- package/dist/commonjs/utils/keepCallAliveHeadlessTask.js +0 -48
- package/dist/commonjs/utils/keepCallAliveHeadlessTask.js.map +0 -1
- package/dist/commonjs/utils/push/libs/callingx.js +0 -75
- package/dist/commonjs/utils/push/libs/callingx.js.map +0 -1
- package/dist/commonjs/utils/push/setupCallingExpEvents.js +0 -108
- package/dist/commonjs/utils/push/setupCallingExpEvents.js.map +0 -1
- package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js +0 -114
- package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js.map +0 -1
- package/dist/module/utils/hooks/useDebouncedValue.js +0 -19
- package/dist/module/utils/hooks/useDebouncedValue.js.map +0 -1
- package/dist/module/utils/internal/callingx/audioSessionPromise.js +0 -51
- package/dist/module/utils/internal/callingx/audioSessionPromise.js.map +0 -1
- package/dist/module/utils/internal/callingx/callingx.js +0 -100
- package/dist/module/utils/internal/callingx/callingx.js.map +0 -1
- package/dist/module/utils/keepCallAliveHeadlessTask.js +0 -42
- package/dist/module/utils/keepCallAliveHeadlessTask.js.map +0 -1
- package/dist/module/utils/push/libs/callingx.js +0 -67
- package/dist/module/utils/push/libs/callingx.js.map +0 -1
- package/dist/module/utils/push/setupCallingExpEvents.js +0 -102
- package/dist/module/utils/push/setupCallingExpEvents.js.map +0 -1
- package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts +0 -5
- package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts.map +0 -1
- package/dist/typescript/utils/hooks/useDebouncedValue.d.ts +0 -8
- package/dist/typescript/utils/hooks/useDebouncedValue.d.ts.map +0 -1
- package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts +0 -16
- package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts.map +0 -1
- package/dist/typescript/utils/internal/callingx/callingx.d.ts +0 -14
- package/dist/typescript/utils/internal/callingx/callingx.d.ts.map +0 -1
- package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts +0 -10
- package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts.map +0 -1
- package/dist/typescript/utils/push/libs/callingx.d.ts +0 -9
- package/dist/typescript/utils/push/libs/callingx.d.ts.map +0 -1
- package/dist/typescript/utils/push/setupCallingExpEvents.d.ts +0 -8
- package/dist/typescript/utils/push/setupCallingExpEvents.d.ts.map +0 -1
- package/src/hooks/push/useCallingExpWithCallingStateEffect.ts +0 -147
- package/src/utils/hooks/useDebouncedValue.ts +0 -21
- package/src/utils/internal/callingx/audioSessionPromise.ts +0 -53
- package/src/utils/internal/callingx/callingx.ts +0 -146
- package/src/utils/keepCallAliveHeadlessTask.ts +0 -54
- package/src/utils/push/libs/callingx.ts +0 -90
- package/src/utils/push/setupCallingExpEvents.ts +0 -130
package/ios/RTCViewPip.swift
CHANGED
|
@@ -10,11 +10,85 @@ import React
|
|
|
10
10
|
|
|
11
11
|
@objc(RTCViewPip)
|
|
12
12
|
class RTCViewPip: UIView {
|
|
13
|
-
|
|
14
|
-
private var pictureInPictureController = StreamPictureInPictureController()
|
|
13
|
+
|
|
14
|
+
private var pictureInPictureController: StreamPictureInPictureController? = StreamPictureInPictureController()
|
|
15
15
|
private var webRtcModule: WebRTCModule?
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
@objc var onPiPChange: RCTBubblingEventBlock?
|
|
18
|
+
|
|
19
|
+
// MARK: - Avatar Placeholder Properties
|
|
20
|
+
|
|
21
|
+
/// The participant's name for the avatar placeholder
|
|
22
|
+
@objc public var participantName: NSString? = nil {
|
|
23
|
+
didSet {
|
|
24
|
+
PictureInPictureLogger.log("RTCViewPip.participantName didSet: \(participantName as String? ?? "nil"), controller exists: \(pictureInPictureController != nil)")
|
|
25
|
+
pictureInPictureController?.participantName = participantName as String?
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/// The URL string for the participant's profile image
|
|
30
|
+
@objc public var participantImageURL: NSString? = nil {
|
|
31
|
+
didSet {
|
|
32
|
+
PictureInPictureLogger.log("RTCViewPip.participantImageURL didSet: \(participantImageURL as String? ?? "nil"), controller exists: \(pictureInPictureController != nil)")
|
|
33
|
+
pictureInPictureController?.participantImageURL = participantImageURL as String?
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// MARK: - Reconnection Properties
|
|
38
|
+
|
|
39
|
+
/// Whether the call is reconnecting - when true, shows reconnection view
|
|
40
|
+
@objc public var isReconnecting: Bool = false {
|
|
41
|
+
didSet {
|
|
42
|
+
pictureInPictureController?.isReconnecting = isReconnecting
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// MARK: - Screen Sharing Properties
|
|
47
|
+
|
|
48
|
+
/// Whether screen sharing is active (used for content state tracking)
|
|
49
|
+
@objc public var isScreenSharing: Bool = false {
|
|
50
|
+
didSet {
|
|
51
|
+
pictureInPictureController?.isScreenSharing = isScreenSharing
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// MARK: - Participant Overlay Properties
|
|
56
|
+
|
|
57
|
+
/// Whether the participant has audio enabled (shown in participant overlay)
|
|
58
|
+
@objc public var hasAudio: Bool = true {
|
|
59
|
+
didSet {
|
|
60
|
+
pictureInPictureController?.hasAudio = hasAudio
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/// Whether the video track is paused (shown in participant overlay)
|
|
65
|
+
@objc public var isTrackPaused: Bool = false {
|
|
66
|
+
didSet {
|
|
67
|
+
pictureInPictureController?.isTrackPaused = isTrackPaused
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/// Whether the participant is pinned (shown in participant overlay)
|
|
72
|
+
@objc public var isPinned: Bool = false {
|
|
73
|
+
didSet {
|
|
74
|
+
pictureInPictureController?.isPinned = isPinned
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/// Whether the participant is currently speaking (shows border highlight)
|
|
79
|
+
@objc public var isSpeaking: Bool = false {
|
|
80
|
+
didSet {
|
|
81
|
+
pictureInPictureController?.isSpeaking = isSpeaking
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/// The connection quality level (0: unknown, 1: poor, 2: good, 3: excellent)
|
|
86
|
+
@objc public var connectionQuality: Int = 0 {
|
|
87
|
+
didSet {
|
|
88
|
+
pictureInPictureController?.connectionQuality = connectionQuality
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
18
92
|
@objc public var mirror: Bool = false {
|
|
19
93
|
didSet {
|
|
20
94
|
self.pictureInPictureController?.isMirrored = mirror
|
|
@@ -38,27 +112,36 @@ class RTCViewPip: UIView {
|
|
|
38
112
|
didSet {
|
|
39
113
|
// https://github.com/react-native-webrtc/react-native-webrtc/blob/8dfc9c394b4bf627c0214255466ebd3b160ca563/ios/RCTWebRTC/RTCVideoViewManager.m#L405-L418
|
|
40
114
|
guard let streamURLString = streamURL as String? else {
|
|
41
|
-
|
|
115
|
+
PictureInPictureLogger.log("No streamURL set, clearing track")
|
|
116
|
+
DispatchQueue.main.async {
|
|
117
|
+
self.applyTrackStateToController(track: nil, isVideoEnabled: false)
|
|
118
|
+
}
|
|
42
119
|
return
|
|
43
120
|
}
|
|
44
|
-
|
|
121
|
+
|
|
45
122
|
guard let stream = self.webRtcModule?.stream(forReactTag: streamURLString) else {
|
|
46
|
-
|
|
123
|
+
PictureInPictureLogger.log("No stream for streamURL: -\(streamURLString), clearing track")
|
|
124
|
+
DispatchQueue.main.async {
|
|
125
|
+
self.applyTrackStateToController(track: nil, isVideoEnabled: false)
|
|
126
|
+
}
|
|
47
127
|
return
|
|
48
128
|
}
|
|
49
|
-
|
|
129
|
+
|
|
50
130
|
guard let videoTrack = stream.videoTracks.first else {
|
|
51
|
-
|
|
131
|
+
PictureInPictureLogger.log("No video track for streamURL: -\(streamURLString), clearing track")
|
|
132
|
+
DispatchQueue.main.async {
|
|
133
|
+
self.applyTrackStateToController(track: nil, isVideoEnabled: false)
|
|
134
|
+
}
|
|
52
135
|
return
|
|
53
136
|
}
|
|
54
|
-
if (self.pictureInPictureController?.track
|
|
55
|
-
|
|
137
|
+
if isSameTrackInstance(self.pictureInPictureController?.track, videoTrack) {
|
|
138
|
+
PictureInPictureLogger.log("Skipping video track for streamURL: -\(streamURLString)")
|
|
56
139
|
return
|
|
57
140
|
}
|
|
58
|
-
|
|
141
|
+
|
|
59
142
|
DispatchQueue.main.async {
|
|
60
|
-
|
|
61
|
-
self.
|
|
143
|
+
PictureInPictureLogger.log("Setting video track for streamURL: -\(streamURLString) trackId: \(videoTrack.trackId)")
|
|
144
|
+
self.applyTrackStateToController(track: videoTrack, isVideoEnabled: true)
|
|
62
145
|
}
|
|
63
146
|
}
|
|
64
147
|
}
|
|
@@ -70,30 +153,40 @@ class RTCViewPip: UIView {
|
|
|
70
153
|
|
|
71
154
|
@objc
|
|
72
155
|
func onCallClosed() {
|
|
73
|
-
|
|
156
|
+
PictureInPictureLogger.log("pictureInPictureController cleanup called")
|
|
74
157
|
self.pictureInPictureController?.cleanup()
|
|
75
158
|
self.pictureInPictureController = nil
|
|
76
159
|
}
|
|
77
160
|
|
|
78
161
|
@objc
|
|
79
162
|
func setPreferredContentSize(_ size: CGSize) {
|
|
80
|
-
|
|
163
|
+
PictureInPictureLogger.log("RTCViewPip setPreferredContentSize \(size)")
|
|
81
164
|
self.pictureInPictureController?.setPreferredContentSize(size)
|
|
82
165
|
}
|
|
83
166
|
|
|
84
167
|
override func didMoveToSuperview() {
|
|
85
168
|
super.didMoveToSuperview()
|
|
86
169
|
if self.superview == nil {
|
|
87
|
-
|
|
170
|
+
PictureInPictureLogger.log("RTCViewPip has been removed from its superview.")
|
|
88
171
|
NotificationCenter.default.removeObserver(self)
|
|
89
172
|
DispatchQueue.main.async {
|
|
90
|
-
|
|
173
|
+
PictureInPictureLogger.log("onCallClosed called due to view detaching")
|
|
91
174
|
self.onCallClosed()
|
|
92
175
|
}
|
|
93
176
|
} else {
|
|
94
|
-
|
|
177
|
+
PictureInPictureLogger.log("RTCViewPip has been added to a superview.")
|
|
95
178
|
setupNotificationObserver()
|
|
96
179
|
DispatchQueue.main.async {
|
|
180
|
+
// Recreate controller if it was previously cleaned up
|
|
181
|
+
// This allows PiP to work again for subsequent calls
|
|
182
|
+
let wasNil = self.pictureInPictureController == nil
|
|
183
|
+
if wasNil {
|
|
184
|
+
PictureInPictureLogger.log("Recreating pictureInPictureController for new session")
|
|
185
|
+
self.pictureInPictureController = StreamPictureInPictureController()
|
|
186
|
+
// Re-apply all current properties to the new controller
|
|
187
|
+
// This is necessary because React Native may have set props while controller was nil
|
|
188
|
+
self.applyCurrentPropertiesToController()
|
|
189
|
+
}
|
|
97
190
|
self.pictureInPictureController?.sourceView = self
|
|
98
191
|
self.pictureInPictureController?.isMirrored = self.mirror
|
|
99
192
|
// Set up PiP state change callback
|
|
@@ -103,20 +196,93 @@ class RTCViewPip: UIView {
|
|
|
103
196
|
if let reactTag = self.reactTag, let bridge = self.webRtcModule?.bridge {
|
|
104
197
|
if let manager = bridge.module(for: RTCViewPipManager.self) as? RTCViewPipManager,
|
|
105
198
|
let size = manager.getCachedSize(for: reactTag) {
|
|
106
|
-
|
|
199
|
+
PictureInPictureLogger.log("Applying cached size \(size) for reactTag \(reactTag)")
|
|
107
200
|
self.setPreferredContentSize(size)
|
|
108
201
|
}
|
|
109
202
|
}
|
|
110
203
|
}
|
|
111
204
|
}
|
|
112
205
|
}
|
|
206
|
+
|
|
207
|
+
/// Re-applies all current property values to the controller.
|
|
208
|
+
/// This is needed after controller recreation because didSet doesn't fire
|
|
209
|
+
/// when the property values haven't changed on the React Native side.
|
|
210
|
+
///
|
|
211
|
+
/// NOTE: This reads from RTCViewPip's own properties (self.participantName, etc.)
|
|
212
|
+
/// which retain their values even after controller cleanup.
|
|
213
|
+
private func applyCurrentPropertiesToController() {
|
|
214
|
+
guard let controller = pictureInPictureController else {
|
|
215
|
+
PictureInPictureLogger.log("applyCurrentPropertiesToController: controller is nil, skipping")
|
|
216
|
+
return
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
PictureInPictureLogger.log("applyCurrentPropertiesToController STARTING:")
|
|
220
|
+
PictureInPictureLogger.log(" participantName: '\(participantName as String? ?? "nil")'")
|
|
221
|
+
PictureInPictureLogger.log(" participantImageURL: '\(participantImageURL as String? ?? "nil")'")
|
|
222
|
+
PictureInPictureLogger.log(" streamURL: '\(streamURL as String? ?? "nil")'")
|
|
223
|
+
|
|
224
|
+
let resolvedTrack: RTCVideoTrack?
|
|
225
|
+
let isVideoEnabled: Bool
|
|
226
|
+
if let streamURLString = streamURL as String?,
|
|
227
|
+
let stream = webRtcModule?.stream(forReactTag: streamURLString),
|
|
228
|
+
let videoTrack = stream.videoTracks.first {
|
|
229
|
+
PictureInPictureLogger.log("Re-applying track from streamURL: \(streamURLString), trackId: \(videoTrack.trackId)")
|
|
230
|
+
resolvedTrack = videoTrack
|
|
231
|
+
isVideoEnabled = true
|
|
232
|
+
} else {
|
|
233
|
+
// No stream URL or no track means video is disabled - show avatar
|
|
234
|
+
PictureInPictureLogger.log("No valid stream/track, setting isVideoEnabled=false for avatar")
|
|
235
|
+
resolvedTrack = nil
|
|
236
|
+
isVideoEnabled = false
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// Keep PiP content transitions store-driven with one snapshot update.
|
|
240
|
+
controller.applyContentSnapshot(
|
|
241
|
+
track: resolvedTrack,
|
|
242
|
+
participantName: participantName as String?,
|
|
243
|
+
participantImageURL: participantImageURL as String?,
|
|
244
|
+
isVideoEnabled: isVideoEnabled,
|
|
245
|
+
isScreenSharing: isScreenSharing,
|
|
246
|
+
isReconnecting: isReconnecting
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
controller.hasAudio = hasAudio
|
|
250
|
+
controller.isTrackPaused = isTrackPaused
|
|
251
|
+
controller.isPinned = isPinned
|
|
252
|
+
controller.isSpeaking = isSpeaking
|
|
253
|
+
controller.connectionQuality = connectionQuality
|
|
254
|
+
PictureInPictureLogger.log("applyCurrentPropertiesToController COMPLETED")
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/// Applies track/video availability without splitting a single change into multiple setters.
|
|
258
|
+
private func applyTrackStateToController(track: RTCVideoTrack?, isVideoEnabled: Bool) {
|
|
259
|
+
pictureInPictureController?.applyContentSnapshot(
|
|
260
|
+
track: track,
|
|
261
|
+
participantName: participantName as String?,
|
|
262
|
+
participantImageURL: participantImageURL as String?,
|
|
263
|
+
isVideoEnabled: isVideoEnabled,
|
|
264
|
+
isScreenSharing: isScreenSharing,
|
|
265
|
+
isReconnecting: isReconnecting
|
|
266
|
+
)
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
private func isSameTrackInstance(_ lhs: RTCVideoTrack?, _ rhs: RTCVideoTrack?) -> Bool {
|
|
270
|
+
switch (lhs, rhs) {
|
|
271
|
+
case (nil, nil):
|
|
272
|
+
return true
|
|
273
|
+
case let (lhsTrack?, rhsTrack?):
|
|
274
|
+
return lhsTrack === rhsTrack
|
|
275
|
+
default:
|
|
276
|
+
return false
|
|
277
|
+
}
|
|
278
|
+
}
|
|
113
279
|
|
|
114
280
|
private func sendPiPChangeEvent(isActive: Bool) {
|
|
115
281
|
guard let onPiPChange = onPiPChange else {
|
|
116
282
|
return
|
|
117
283
|
}
|
|
118
|
-
|
|
119
|
-
|
|
284
|
+
|
|
285
|
+
PictureInPictureLogger.log("Sending PiP state change event: \(isActive)")
|
|
120
286
|
onPiPChange(["active": isActive])
|
|
121
287
|
}
|
|
122
288
|
}
|
package/ios/RTCViewPipManager.mm
CHANGED
|
@@ -13,6 +13,15 @@
|
|
|
13
13
|
RCT_EXPORT_VIEW_PROPERTY(streamURL, NSString)
|
|
14
14
|
RCT_EXPORT_VIEW_PROPERTY(mirror, BOOL)
|
|
15
15
|
RCT_EXPORT_VIEW_PROPERTY(onPiPChange, RCTBubblingEventBlock)
|
|
16
|
+
RCT_EXPORT_VIEW_PROPERTY(participantName, NSString)
|
|
17
|
+
RCT_EXPORT_VIEW_PROPERTY(participantImageURL, NSString)
|
|
18
|
+
RCT_EXPORT_VIEW_PROPERTY(isReconnecting, BOOL)
|
|
19
|
+
RCT_EXPORT_VIEW_PROPERTY(isScreenSharing, BOOL)
|
|
20
|
+
RCT_EXPORT_VIEW_PROPERTY(hasAudio, BOOL)
|
|
21
|
+
RCT_EXPORT_VIEW_PROPERTY(isTrackPaused, BOOL)
|
|
22
|
+
RCT_EXPORT_VIEW_PROPERTY(isPinned, BOOL)
|
|
23
|
+
RCT_EXPORT_VIEW_PROPERTY(isSpeaking, BOOL)
|
|
24
|
+
RCT_EXPORT_VIEW_PROPERTY(connectionQuality, NSInteger)
|
|
16
25
|
RCT_EXTERN_METHOD(onCallClosed:(nonnull NSNumber*) reactTag)
|
|
17
26
|
RCT_EXTERN_METHOD(setPreferredContentSize:(nonnull NSNumber *)reactTag width:(CGFloat)w height:(CGFloat)h);
|
|
18
27
|
|
|
@@ -32,7 +32,7 @@ class RTCViewPipManager: RCTViewManager {
|
|
|
32
32
|
pipView.onCallClosed()
|
|
33
33
|
}
|
|
34
34
|
} else {
|
|
35
|
-
|
|
35
|
+
PictureInPictureLogger.log("onCallClosed cant be called, Invalid view returned from registry, expecting RTCViewPip")
|
|
36
36
|
}
|
|
37
37
|
})
|
|
38
38
|
}
|
|
@@ -51,7 +51,7 @@ class RTCViewPipManager: RCTViewManager {
|
|
|
51
51
|
} else {
|
|
52
52
|
// If the view is not found, cache the size.
|
|
53
53
|
// this happens when this method is called before the view can attach react super view
|
|
54
|
-
|
|
54
|
+
PictureInPictureLogger.log("View not found for reactTag \(reactTag), caching size.")
|
|
55
55
|
self.cachedSizes[reactTag] = size
|
|
56
56
|
}
|
|
57
57
|
})
|
|
@@ -60,7 +60,7 @@ class RTCViewPipManager: RCTViewManager {
|
|
|
60
60
|
func getCachedSize(for reactTag: NSNumber) -> CGSize? {
|
|
61
61
|
let size = self.cachedSizes.removeValue(forKey: reactTag)
|
|
62
62
|
if size != nil {
|
|
63
|
-
|
|
63
|
+
PictureInPictureLogger.log("Found and removed cached size for reactTag \(reactTag).")
|
|
64
64
|
}
|
|
65
65
|
return size
|
|
66
66
|
}
|
|
@@ -116,7 +116,7 @@ class StreamInCallManager: RCTEventEmitter {
|
|
|
116
116
|
}
|
|
117
117
|
} else {
|
|
118
118
|
intendedCategory = .playAndRecord
|
|
119
|
-
intendedMode = .voiceChat
|
|
119
|
+
intendedMode = defaultAudioDevice == .speaker ? .videoChat : .voiceChat
|
|
120
120
|
|
|
121
121
|
// XCode 16 and older don't expose .allowBluetoothHFP
|
|
122
122
|
// https://forums.swift.org/t/xcode-26-avaudiosession-categoryoptions-allowbluetooth-deprecated/80956
|
|
@@ -132,7 +132,6 @@ class StreamInCallManager: RCTEventEmitter {
|
|
|
132
132
|
rtcConfig.category = intendedCategory.rawValue
|
|
133
133
|
rtcConfig.mode = intendedMode.rawValue
|
|
134
134
|
rtcConfig.categoryOptions = intendedOptions
|
|
135
|
-
// This ensures WebRTC's internal state stays consistent during interruptions/route changes
|
|
136
135
|
RTCAudioSessionConfiguration.setWebRTC(rtcConfig)
|
|
137
136
|
|
|
138
137
|
let session = RTCAudioSession.sharedInstance()
|
|
@@ -141,7 +140,7 @@ class StreamInCallManager: RCTEventEmitter {
|
|
|
141
140
|
session.unlockForConfiguration()
|
|
142
141
|
}
|
|
143
142
|
do {
|
|
144
|
-
try session.
|
|
143
|
+
try session.setCategory(intendedCategory, mode: intendedMode, options: intendedOptions)
|
|
145
144
|
if (wasRecording) {
|
|
146
145
|
try adm.setRecording(wasRecording)
|
|
147
146
|
}
|
|
@@ -267,11 +266,6 @@ class StreamInCallManager: RCTEventEmitter {
|
|
|
267
266
|
|
|
268
267
|
@objc
|
|
269
268
|
func logAudioState() {
|
|
270
|
-
log(getAudioStateLog())
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
@objc(getAudioStateLog)
|
|
274
|
-
func getAudioStateLog() -> String {
|
|
275
269
|
let session = AVAudioSession.sharedInstance()
|
|
276
270
|
let adm = getAudioDeviceModule()
|
|
277
271
|
|
|
@@ -284,7 +278,7 @@ class StreamInCallManager: RCTEventEmitter {
|
|
|
284
278
|
|
|
285
279
|
let rtcAVSession = rtcSession.session
|
|
286
280
|
let logString = """
|
|
287
|
-
|
|
281
|
+
Audio State:
|
|
288
282
|
Category: \(session.category.rawValue)
|
|
289
283
|
Mode: \(session.mode.rawValue)
|
|
290
284
|
Output Port: \(session.currentRoute.outputs.first?.portName ?? "N/A")
|
|
@@ -292,16 +286,10 @@ class StreamInCallManager: RCTEventEmitter {
|
|
|
292
286
|
Category Options: \(session.categoryOptions)
|
|
293
287
|
InputNumberOfChannels: \(session.inputNumberOfChannels)
|
|
294
288
|
OutputNumberOfChannels: \(session.outputNumberOfChannels)
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
IsPlaying: \(adm.isPlaying)
|
|
298
|
-
IsRecording: \(adm.isRecording)
|
|
299
|
-
IsVoiceProcessingAGCEnabled: \(adm.isVoiceProcessingAGCEnabled)
|
|
300
|
-
IsVoiceProcessingBypassed: \(adm.isVoiceProcessingBypassed)
|
|
301
|
-
IsVoiceProcessingEnabled: \(adm.isVoiceProcessingEnabled)
|
|
302
|
-
IsStereoPlayoutEnabled: \(adm.isStereoPlayoutEnabled)
|
|
289
|
+
AdmIsPlaying: \(adm.isPlaying)
|
|
290
|
+
AdmIsRecording: \(adm.isRecording)
|
|
303
291
|
|
|
304
|
-
|
|
292
|
+
RTC Audio State:
|
|
305
293
|
Wrapped Category: \(rtcAVSession.category.rawValue)
|
|
306
294
|
Wrapped Mode: \(rtcAVSession.mode.rawValue)
|
|
307
295
|
Wrapped Output Port: \(rtcAVSession.currentRoute.outputs.first?.portName ?? "N/A")
|
|
@@ -312,7 +300,7 @@ class StreamInCallManager: RCTEventEmitter {
|
|
|
312
300
|
IsActive: \(rtcSession.isActive)
|
|
313
301
|
ActivationCount: \(rtcSession.activationCount)
|
|
314
302
|
"""
|
|
315
|
-
|
|
303
|
+
log(logString)
|
|
316
304
|
}
|
|
317
305
|
|
|
318
306
|
@objc(muteAudioOutput)
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
#import <React/RCTEventEmitter.h>
|
|
2
2
|
#import <React/RCTBridge.h>
|
|
3
|
-
#import <PushKit/PushKit.h>
|
|
4
3
|
|
|
5
4
|
@interface StreamVideoReactNative : RCTEventEmitter <RCTBridgeModule>
|
|
6
5
|
|
|
7
6
|
- (void)screenShareEventReceived:(NSString *)event;
|
|
8
7
|
|
|
9
|
-
+ (void)
|
|
10
|
-
|
|
11
|
-
+ (BOOL)hasAnyActiveCall;
|
|
8
|
+
+ (void)registerIncomingCall:(NSString *)cid uuid:(NSString *)uuid;
|
|
12
9
|
|
|
13
|
-
+ (void)
|
|
10
|
+
+ (void)setup DEPRECATED_MSG_ATTRIBUTE("No need to use setup() anymore");
|
|
14
11
|
|
|
15
|
-
+ (
|
|
12
|
+
+ (BOOL)shouldRejectCallWhenBusy;
|
|
16
13
|
|
|
17
|
-
+ (
|
|
14
|
+
+ (BOOL)hasAnyActiveCall;
|
|
18
15
|
|
|
19
16
|
@end
|