expo-realtime-ivs-broadcast 0.2.1 → 0.2.2

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/README.md CHANGED
@@ -8,7 +8,8 @@ This module provides React Native components and a comprehensive API to integrat
8
8
 
9
9
  | Library Version | Expo SDK | React Native | React | Notes |
10
10
  |-----------------|----------|--------------|---------|-------|
11
- | 0.2.0 | 54 | 0.81.x | 19.1.x | **Added Picture-in-Picture support** |
11
+ | 0.2.1 | 54 | 0.81.x | 19.1.x | **Fixed iOS PiP pre-warming reliability** |
12
+ | 0.2.0 | 54 | 0.81.x | 19.1.x | Added Picture-in-Picture support |
12
13
  | 0.1.7 | 54 | 0.81.x | 19.1.x | |
13
14
  | 0.1.4 | 53 | 0.79.x | 19.0.x | |
14
15
 
@@ -1060,10 +1060,21 @@ class IVSStageManager: NSObject, IVSStageStreamDelegate, IVSStageStrategy, IVSSt
1060
1060
  } catch {
1061
1061
  print("🖼️ [PiP] Warning: Could not get preview view from device: \(error)")
1062
1062
  // Try to find a remote view that's rendering this device
1063
- if let remoteView = remoteViews.compactMap({ $0.value }).first(where: { $0.currentRenderedDeviceUrn == device.descriptor().urn }),
1064
- let previewViewForPiP = remoteView.previewViewForPiP {
1063
+ if let remoteView = remoteViews.compactMap({ $0.value }).first(where: { $0.currentRenderedDeviceUrn == device.descriptor().urn }) {
1064
+ // Always set up with the remote view container - it's the visible video view
1065
1065
  pipController.setupWithSourceView(remoteView as UIView)
1066
- pipTargetView = previewViewForPiP
1066
+ // Use the inner preview view if available, otherwise use the container
1067
+ pipTargetView = remoteView.previewViewForPiP ?? remoteView
1068
+ print("🖼️ [PiP] Set up with remote view container")
1069
+ } else {
1070
+ // Last resort: try to find ANY registered remote view that's rendering video
1071
+ if let anyRemoteView = remoteViews.compactMap({ $0.value }).first(where: { $0.isRenderingVideo }) {
1072
+ pipController.setupWithSourceView(anyRemoteView as UIView)
1073
+ pipTargetView = anyRemoteView.previewViewForPiP ?? anyRemoteView
1074
+ print("🖼️ [PiP] Set up with fallback remote view")
1075
+ } else {
1076
+ print("🖼️ [PiP] ERROR: No source view found for PiP - controller will not be initialized!")
1077
+ }
1067
1078
  }
1068
1079
  }
1069
1080
  }
@@ -1117,6 +1128,12 @@ class IVSStageManager: NSObject, IVSStageStreamDelegate, IVSStageStrategy, IVSSt
1117
1128
  // Cast to UIView explicitly since ExpoIVSRemoteStreamView extends ExpoView -> UIView
1118
1129
  candidateSourceView = remoteView as UIView
1119
1130
  print("🖼️ [PiP] Found matching remote view for source")
1131
+ } else {
1132
+ // Fallback: use any remote view that's rendering video
1133
+ if let anyRenderingView = remoteViews.compactMap({ $0.value }).first(where: { $0.isRenderingVideo }) {
1134
+ candidateSourceView = anyRenderingView as UIView
1135
+ print("🖼️ [PiP] Using fallback remote view for source (URN mismatch)")
1136
+ }
1120
1137
  }
1121
1138
 
1122
1139
  attachToDevice(imageDevice, sourceView: candidateSourceView)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-realtime-ivs-broadcast",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "An Expo module for real-time broadcasting using Amazon IVS.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",