@stream-io/video-react-native-sdk 1.24.2 → 1.24.3

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.
Files changed (24) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/android/src/main/AndroidManifest.xml +1 -0
  3. package/android/src/main/java/com/streamvideo/reactnative/audio/AudioDeviceManager.kt +11 -2
  4. package/android/src/main/java/com/streamvideo/reactnative/callmanager/ProximityManager.kt +4 -27
  5. package/android/src/main/java/com/streamvideo/reactnative/callmanager/StreamInCallManagerModule.kt +6 -9
  6. package/dist/commonjs/components/Participant/FloatingParticipantView/index.js +1 -1
  7. package/dist/commonjs/components/Participant/FloatingParticipantView/index.js.map +1 -1
  8. package/dist/commonjs/components/Participant/FloatingParticipantView/useFloatingVideoDimensions.js +25 -12
  9. package/dist/commonjs/components/Participant/FloatingParticipantView/useFloatingVideoDimensions.js.map +1 -1
  10. package/dist/commonjs/version.js +1 -1
  11. package/dist/module/components/Participant/FloatingParticipantView/index.js +1 -1
  12. package/dist/module/components/Participant/FloatingParticipantView/index.js.map +1 -1
  13. package/dist/module/components/Participant/FloatingParticipantView/useFloatingVideoDimensions.js +25 -12
  14. package/dist/module/components/Participant/FloatingParticipantView/useFloatingVideoDimensions.js.map +1 -1
  15. package/dist/module/version.js +1 -1
  16. package/dist/typescript/components/Participant/FloatingParticipantView/index.d.ts.map +1 -1
  17. package/dist/typescript/components/Participant/FloatingParticipantView/useFloatingVideoDimensions.d.ts +1 -4
  18. package/dist/typescript/components/Participant/FloatingParticipantView/useFloatingVideoDimensions.d.ts.map +1 -1
  19. package/dist/typescript/version.d.ts +1 -1
  20. package/ios/StreamInCallManager.swift +5 -1
  21. package/package.json +3 -3
  22. package/src/components/Participant/FloatingParticipantView/index.tsx +0 -1
  23. package/src/components/Participant/FloatingParticipantView/useFloatingVideoDimensions.tsx +27 -18
  24. package/src/version.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.24.3](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.24.2...@stream-io/video-react-native-sdk-1.24.3) (2025-11-12)
6
+
7
+ ### Dependency Updates
8
+
9
+ - `@stream-io/video-client` updated to version `1.36.1`
10
+ - `@stream-io/video-react-bindings` updated to version `1.11.0`
11
+
12
+ ### Bug Fixes
13
+
14
+ - improve android wake lock and power manager handling RN-291 ([#1990](https://github.com/GetStream/stream-video-js/issues/1990)) ([28096ad](https://github.com/GetStream/stream-video-js/commit/28096ad9b14848b352afa358dcaf655cbcfb0626)), closes [#1971](https://github.com/GetStream/stream-video-js/issues/1971)
15
+ - missing adaptive floating dimensions for landscape video ([#1983](https://github.com/GetStream/stream-video-js/issues/1983)) ([7803f2c](https://github.com/GetStream/stream-video-js/commit/7803f2cd80e9680974803fb72b3e5b4bf8caba7c))
16
+
5
17
  ## [1.24.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.24.1...@stream-io/video-react-native-sdk-1.24.2) (2025-11-05)
6
18
 
7
19
  ### Dependency Updates
@@ -3,4 +3,5 @@
3
3
 
4
4
  <uses-permission android:name="android.permission.INTERNET" />
5
5
  <uses-permission android:name="android.permission.DEVICE_POWER" />
6
+ <uses-permission android:name="android.permission.WAKE_LOCK" />
6
7
  </manifest>
@@ -33,6 +33,7 @@ import com.streamvideo.reactnative.audio.utils.AudioManagerUtil
33
33
  import com.streamvideo.reactnative.audio.utils.AudioManagerUtil.Companion.getAvailableAudioDevices
34
34
  import com.streamvideo.reactnative.audio.utils.AudioSetupStoreUtil
35
35
  import com.streamvideo.reactnative.audio.utils.CallAudioRole
36
+ import com.streamvideo.reactnative.callmanager.ProximityManager
36
37
  import com.streamvideo.reactnative.callmanager.StreamInCallManagerModule
37
38
  import com.streamvideo.reactnative.model.AudioDeviceEndpoint
38
39
  import com.streamvideo.reactnative.model.AudioDeviceEndpoint.Companion.EndpointType
@@ -70,12 +71,15 @@ class AudioDeviceManager(
70
71
 
71
72
  /** Returns the currently selected audio device. */
72
73
  private var _selectedAudioDeviceEndpoint: AudioDeviceEndpoint? = null
73
- private var selectedAudioDeviceEndpoint: AudioDeviceEndpoint?
74
+ var selectedAudioDeviceEndpoint: AudioDeviceEndpoint?
74
75
  get() = _selectedAudioDeviceEndpoint
75
76
  set(value) {
76
77
  _selectedAudioDeviceEndpoint = value
77
78
  // send an event to the frontend everytime this endpoint changes
78
79
  sendAudioStatusEvent()
80
+ if (callAudioRole == CallAudioRole.Communicator) {
81
+ proximityManager.update()
82
+ }
79
83
  }
80
84
 
81
85
  // Default audio device; speaker phone for video calls or earpiece for audio only phone calls
@@ -101,6 +105,8 @@ class AudioDeviceManager(
101
105
 
102
106
  val bluetoothManager = BluetoothManager(mReactContext, this)
103
107
 
108
+ private val proximityManager by lazy { ProximityManager(mReactContext, this) }
109
+
104
110
  init {
105
111
  // Note that we will immediately receive a call to onDevicesAdded with the list of
106
112
  // devices which are currently connected.
@@ -120,6 +126,7 @@ class AudioDeviceManager(
120
126
  bluetoothManager.start()
121
127
  mAudioManager.registerAudioDeviceCallback(this, null)
122
128
  updateAudioDeviceState()
129
+ proximityManager.start()
123
130
  } else {
124
131
  // Audio routing is handled automatically by the system in normal media mode
125
132
  // and bluetooth microphones may not work on some devices.
@@ -141,6 +148,7 @@ class AudioDeviceManager(
141
148
  mAudioManager.setSpeakerphoneOn(false)
142
149
  }
143
150
  bluetoothManager.stop()
151
+ proximityManager.stop()
144
152
  }
145
153
  audioSetupStoreUtil.restoreOriginalAudioSetup()
146
154
  audioFocusUtil.abandonFocus()
@@ -221,6 +229,7 @@ class AudioDeviceManager(
221
229
 
222
230
  override fun close() {
223
231
  mAudioManager.unregisterAudioDeviceCallback(this)
232
+ proximityManager.onDestroy()
224
233
  }
225
234
 
226
235
  override fun onAudioDevicesAdded(addedDevices: Array<out AudioDeviceInfo>?) {
@@ -522,7 +531,7 @@ class AudioDeviceManager(
522
531
  }
523
532
  }
524
533
 
525
- private fun audioStatusMap(): WritableMap {
534
+ fun audioStatusMap(): WritableMap {
526
535
  val endpoint = this.selectedAudioDeviceEndpoint
527
536
  val availableEndpoints = Arguments.fromList(getCurrentDeviceEndpoints().map { it.name })
528
537
 
@@ -8,6 +8,7 @@ import android.media.AudioDeviceInfo
8
8
  import android.media.AudioManager
9
9
  import android.os.PowerManager
10
10
  import android.util.Log
11
+ import com.streamvideo.reactnative.audio.AudioDeviceManager
11
12
 
12
13
  /**
13
14
  * Encapsulates Android proximity sensor handling for in-call UX.
@@ -20,6 +21,7 @@ import android.util.Log
20
21
  */
21
22
  class ProximityManager(
22
23
  private val context: Context,
24
+ private val audioDeviceManager: AudioDeviceManager,
23
25
  ) {
24
26
 
25
27
  companion object {
@@ -67,10 +69,7 @@ class ProximityManager(
67
69
  }
68
70
  try {
69
71
  powerManager = context.getSystemService(Context.POWER_SERVICE) as PowerManager
70
- // Obtain PROXIMITY_SCREEN_OFF_WAKE_LOCK via reflection to avoid compile-time dependency
71
- val field = PowerManager::class.java.getField("PROXIMITY_SCREEN_OFF_WAKE_LOCK")
72
- val level = field.getInt(null)
73
- proximityWakeLock = powerManager?.newWakeLock(level, "$TAG:Proximity")
72
+ proximityWakeLock = powerManager?.newWakeLock(PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK, "$TAG:Proximity")
74
73
  } catch (t: Throwable) {
75
74
  Log.w(TAG, "Proximity wakelock init failed (may be unsupported on this device)", t)
76
75
  proximityWakeLock = null
@@ -156,28 +155,6 @@ class ProximityManager(
156
155
  }
157
156
 
158
157
  private fun isOnEarpiece(): Boolean {
159
- val audioManager = context.getSystemService(Context.AUDIO_SERVICE) as AudioManager
160
- // If speakerphone is on, not earpiece
161
- if (audioManager.isSpeakerphoneOn) return false
162
-
163
- // Check if Bluetooth SCO/A2DP or wired headset is connected
164
- var hasBt = false
165
- var hasWired = false
166
- val outputs = audioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS)
167
- outputs.forEach { dev ->
168
- val type = dev.type
169
- if (type == AudioDeviceInfo.TYPE_BLUETOOTH_A2DP ||
170
- type == AudioDeviceInfo.TYPE_BLUETOOTH_SCO
171
- ) {
172
- hasBt = true
173
- } else if (type == AudioDeviceInfo.TYPE_WIRED_HEADPHONES
174
- || type == AudioDeviceInfo.TYPE_WIRED_HEADSET
175
- || type == AudioDeviceInfo.TYPE_USB_HEADSET
176
- ) {
177
- hasWired = true
178
- }
179
- }
180
-
181
- return !hasBt && !hasWired
158
+ return audioDeviceManager.selectedAudioDeviceEndpoint?.isEarpieceType() ?: false
182
159
  }
183
160
  }
@@ -3,6 +3,7 @@ package com.streamvideo.reactnative.callmanager
3
3
  import android.util.Log
4
4
  import android.view.WindowManager
5
5
  import com.facebook.react.bridge.LifecycleEventListener
6
+ import com.facebook.react.bridge.Promise
6
7
  import com.facebook.react.bridge.ReactApplicationContext
7
8
  import com.facebook.react.bridge.ReactContextBaseJavaModule
8
9
  import com.facebook.react.bridge.ReactMethod
@@ -20,7 +21,6 @@ class StreamInCallManagerModule(reactContext: ReactApplicationContext) :
20
21
  private var audioManagerActivated = false
21
22
 
22
23
  private val mAudioDeviceManager = AudioDeviceManager(reactContext)
23
- private val proximityManager = ProximityManager(reactContext)
24
24
 
25
25
  override fun getName(): String {
26
26
  return TAG
@@ -89,8 +89,6 @@ class StreamInCallManagerModule(reactContext: ReactApplicationContext) :
89
89
  mAudioDeviceManager.start(it)
90
90
  setKeepScreenOn(true)
91
91
  audioManagerActivated = true
92
- // Initialize and evaluate proximity monitoring via controller
93
- proximityManager.start()
94
92
  }
95
93
  }
96
94
  }
@@ -103,8 +101,6 @@ class StreamInCallManagerModule(reactContext: ReactApplicationContext) :
103
101
  Log.d(TAG, "stop() mAudioDeviceManager")
104
102
  mAudioDeviceManager.stop()
105
103
  setMicrophoneMute(false)
106
- // Disable proximity monitoring via controller and clear keep-screen-on
107
- proximityManager.stop()
108
104
  setKeepScreenOn(false)
109
105
  audioManagerActivated = false
110
106
  }
@@ -133,8 +129,6 @@ class StreamInCallManagerModule(reactContext: ReactApplicationContext) :
133
129
  return
134
130
  }
135
131
  mAudioDeviceManager.setSpeakerphoneOn(enable)
136
- // Re-evaluate proximity monitoring when route may change
137
- this.proximityManager.update()
138
132
  }
139
133
 
140
134
  @ReactMethod
@@ -142,6 +136,11 @@ class StreamInCallManagerModule(reactContext: ReactApplicationContext) :
142
136
  mAudioDeviceManager.setMicrophoneMute(enable)
143
137
  }
144
138
 
139
+ @ReactMethod
140
+ fun getAudioDeviceStatus(promise: Promise) {
141
+ promise.resolve(mAudioDeviceManager.audioStatusMap())
142
+ }
143
+
145
144
  @ReactMethod
146
145
  fun logAudioState() {
147
146
  WebRtcAudioUtils.logAudioState(
@@ -160,8 +159,6 @@ class StreamInCallManagerModule(reactContext: ReactApplicationContext) :
160
159
  mAudioDeviceManager.switchDeviceFromDeviceName(
161
160
  endpointDeviceName
162
161
  )
163
- // Re-evaluate proximity monitoring when endpoint changes
164
- this.proximityManager.update()
165
162
  }
166
163
 
167
164
  @ReactMethod
@@ -80,7 +80,7 @@ const FloatingParticipantView = ({
80
80
  'bottom-right': _common.FloatingViewAlignment.bottomRight
81
81
  };
82
82
  const [containerDimensions, setContainerDimensions] = _react.default.useState();
83
- const floatingVideoDimensions = (0, _useFloatingVideoDimensions.useFloatingVideoDimensions)(containerDimensions, participant, 'videoTrack');
83
+ const floatingVideoDimensions = (0, _useFloatingVideoDimensions.useFloatingVideoDimensions)(participant, 'videoTrack');
84
84
  const participantViewProps = {
85
85
  ParticipantLabel: null,
86
86
  ParticipantNetworkQualityIndicator,
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_constants","_TestIds","_icons","_FloatingView","_common","_ParticipantView","_ThemeContext","_useFloatingVideoDimensions","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","DefaultLocalParticipantViewVideoFallback","theme","colors","floatingParticipantsView","variants","iconSizes","defaults","useTheme","createElement","View","style","styles","videoFallback","backgroundColor","sheetSecondary","height","md","width","VideoSlash","color","iconPrimary","size","iconSize","FloatingParticipantView","alignment","onPressHandler","participant","participantViewStyle","draggableContainerStyle","ParticipantView","DefaultParticipantView","ParticipantNetworkQualityIndicator","ParticipantVideoFallback","ParticipantReaction","VideoRenderer","supportedReactions","videoZOrder","objectFit","spacingSizes","floatingAlignmentMap","FloatingViewAlignment","topLeft","topRight","bottomLeft","bottomRight","containerDimensions","setContainerDimensions","React","useState","floatingVideoDimensions","useFloatingVideoDimensions","participantViewProps","ParticipantLabel","testID","ComponentTestIds","LOCAL_PARTICIPANT","container","pointerEvents","onLayout","event","nativeEvent","layout","prev","containerHeight","containerWidth","initialAlignment","Pressable","onPress","trackType","participantViewContainer","borderRadius","marginHorizontal","shadowColor","sheetPrimary","exports","StyleSheet","create","zIndex","Z_INDEX","IN_MIDDLE","flex","shadowOffset","shadowOpacity","shadowRadius","elevation","absoluteFillObject","alignItems","justifyContent"],"sourceRoot":"../../../../../src","sources":["components/Participant/FloatingParticipantView/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAN,sBAAA,CAAAC,OAAA;AAKA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,gBAAA,GAAAP,OAAA;AAKA,IAAAQ,aAAA,GAAAR,OAAA;AACA,IAAAS,2BAAA,GAAAT,OAAA;AAA0E,SAAAD,uBAAAW,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,SAAA,WAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GA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BAAoB,CACzB,CAEM,CACC,CAEZ,CAAC;AAEX,CAAC;AAACuB,OAAA,CAAAnD,uBAAA,GAAAA,uBAAA;AAEF,MAAMZ,MAAM,GAAGgE,uBAAU,CAACC,MAAM,CAAC;EAC/BpB,SAAS,EAAE;IACT;IACAqB,MAAM,EAAEC,kBAAO,CAACC,SAAS;IACzBC,IAAI,EAAE;EACR,CAAC;EACDX,wBAAwB,EAAE;IACxBY,YAAY,EAAE;MACZhE,KAAK,EAAE,CAAC;MACRF,MAAM,EAAE;IACV,CAAC;IACDmE,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE,IAAI;IAClBC,SAAS,EAAE;EACb,CAAC;EACDxE,aAAa,EAAE;IACb,GAAG+D,uBAAU,CAACU,kBAAkB;IAChCC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_constants","_TestIds","_icons","_FloatingView","_common","_ParticipantView","_ThemeContext","_useFloatingVideoDimensions","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","DefaultLocalParticipantViewVideoFallback","theme","colors","floatingParticipantsView","variants","iconSizes","defaults","useTheme","createElement","View","style","styles","videoFallback","backgroundColor","sheetSecondary","height","md","width","VideoSlash","color","iconPrimary","size","iconSize","FloatingParticipantView","alignment","onPressHandler","participant","participantViewStyle","draggableContainerStyle","ParticipantView","DefaultParticipantView","ParticipantNetworkQualityIndicator","ParticipantVideoFallback","ParticipantReaction","VideoRenderer","supportedReactions","videoZOrder","objectFit","spacingSizes","floatingAlignmentMap","FloatingViewAlignment","topLeft","topRight","bottomLeft","bottomRight","containerDimensions","setContainerDimensions","React","useState","floatingVideoDimensions","useFloatingVideoDimensions","participantViewProps","ParticipantLabel","testID","ComponentTestIds","LOCAL_PARTICIPANT","container","pointerEvents","onLayout","event","nativeEvent","layout","prev","containerHeight","containerWidth","initialAlignment","Pressable","onPress","trackType","participantViewContainer","borderRadius","marginHorizontal","shadowColor","sheetPrimary","exports","StyleSheet","create","zIndex","Z_INDEX","IN_MIDDLE","flex","shadowOffset","shadowOpacity","shadowRadius","elevation","absoluteFillObject","alignItems","justifyContent"],"sourceRoot":"../../../../../src","sources":["components/Participant/FloatingParticipantView/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAN,sBAAA,CAAAC,OAAA;AAKA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,gBAAA,GAAAP,OAAA;AAKA,IAAAQ,aAAA,GAAAR,OAAA;AACA,IAAAS,2BAAA,GAAAT,OAAA;AAA0E,SAAAD,uBAAAW,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,SAAA,WAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,CAAA,aAAAP,CAAA,MAAAA,CAAA,GAAAQ,SAAA,CAAAC,MAAA,EAAAT,CAAA,UAAAU,CAAA,GAAAF,SAAA,CAAAR,CAAA,YAAAW,CAAA,IAAAD,CAAA,OAAAE,cAAA,CAAAC,IAAA,CAAAH,CAAA,EAAAC,CAAA,MAAAJ,CAAA,CAAAI,CAAA,IAAAD,CAAA,CAAAC,CAAA,aAAAJ,CAAA,KAAAJ,QAAA,CAAAW,KAAA,OAAAN,SAAA;AAS1E;AACA;AACA;;AA6BA,MAAMO,wCAAwC,GAAGA,CAAA,KAAM;EACrD,MAAM;IACJC,KAAK,EAAE;MACLC,MAAM;MACNC,wBAAwB;MACxBC,QAAQ,EAAE;QAA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C,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -5,26 +5,39 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useFloatingVideoDimensions = void 0;
7
7
  var _useTrackDimensions = require("../../../hooks/useTrackDimensions");
8
- const useFloatingVideoDimensions = (containerDimensions, participant, trackType) => {
9
- const containerWidth = containerDimensions?.width ?? 0;
8
+ var _reactNative = require("react-native");
9
+ const useFloatingVideoDimensions = (participant, trackType) => {
10
+ const {
11
+ width: containerWidth,
12
+ height: containerHeight
13
+ } = (0, _reactNative.useWindowDimensions)();
10
14
  const {
11
15
  width,
12
16
  height
13
17
  } = (0, _useTrackDimensions.useTrackDimensions)(participant, trackType);
14
- if (width === 0 || height === 0 || containerWidth === 0) {
18
+ if (width === 0 || height === 0 || containerWidth === 0 || containerHeight === 0) {
15
19
  return undefined;
16
20
  }
17
- const aspectRatio = width / height;
18
21
 
19
22
  // based on Android AOSP PiP mode default dimensions algorithm
20
- // 23% of the container width
21
- const floatingVideoWidth = containerWidth * 0.23;
22
- // the height is calculated based on the aspect ratio
23
- const floatingVideoHeight = floatingVideoWidth / aspectRatio;
24
- return {
25
- width: floatingVideoWidth,
26
- height: floatingVideoHeight
27
- };
23
+ // 23% of the shorter container dimension is the base dimension
24
+ const shorterContainerDimension = Math.min(containerWidth, containerHeight);
25
+ const baseDimension = shorterContainerDimension * 0.23;
26
+ const aspectRatio = width / height;
27
+ const isPortraitVideo = aspectRatio < 1;
28
+
29
+ // baseDimension is assigned to either height or width based on whether the video is landscape or portrait
30
+ if (isPortraitVideo) {
31
+ return {
32
+ width: baseDimension,
33
+ height: baseDimension / aspectRatio
34
+ };
35
+ } else {
36
+ return {
37
+ width: baseDimension * aspectRatio,
38
+ height: baseDimension
39
+ };
40
+ }
28
41
  };
29
42
  exports.useFloatingVideoDimensions = useFloatingVideoDimensions;
30
43
  //# sourceMappingURL=useFloatingVideoDimensions.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_useTrackDimensions","require","useFloatingVideoDimensions","containerDimensions","participant","trackType","containerWidth","width","height","useTrackDimensions","undefined","aspectRatio","floatingVideoWidth","floatingVideoHeight","exports"],"sourceRoot":"../../../../../src","sources":["components/Participant/FloatingParticipantView/useFloatingVideoDimensions.tsx"],"mappings":";;;;;;AAIA,IAAAA,mBAAA,GAAAC,OAAA;AAEO,MAAMC,0BAA0B,GAAGA,CACxCC,mBAKa,EACbC,WAA+C,EAC/CC,SAAyB,KACtB;EACH,MAAMC,cAAc,GAAGH,mBAAmB,EAAEI,KAAK,IAAI,CAAC;EACtD,MAAM;IAAEA,KAAK;IAAEC;EAAO,CAAC,GAAG,IAAAC,sCAAkB,EAACL,WAAW,EAAEC,SAAS,CAAC;EAEpE,IAAIE,KAAK,KAAK,CAAC,IAAIC,MAAM,KAAK,CAAC,IAAIF,cAAc,KAAK,CAAC,EAAE;IACvD,OAAOI,SAAS;EAClB;EAEA,MAAMC,WAAW,GAAGJ,KAAK,GAAGC,MAAM;;EAElC;EACA;EACA,MAAMI,kBAAkB,GAAGN,cAAc,GAAG,IAAI;EAChD;EACA,MAAMO,mBAAmB,GAAGD,kBAAkB,GAAGD,WAAW;EAE5D,OAAO;IACLJ,KAAK,EAAEK,kBAAkB;IACzBJ,MAAM,EAAEK;EACV,CAAC;AACH,CAAC;AAACC,OAAA,CAAAZ,0BAAA,GAAAA,0BAAA","ignoreList":[]}
1
+ {"version":3,"names":["_useTrackDimensions","require","_reactNative","useFloatingVideoDimensions","participant","trackType","width","containerWidth","height","containerHeight","useWindowDimensions","useTrackDimensions","undefined","shorterContainerDimension","Math","min","baseDimension","aspectRatio","isPortraitVideo","exports"],"sourceRoot":"../../../../../src","sources":["components/Participant/FloatingParticipantView/useFloatingVideoDimensions.tsx"],"mappings":";;;;;;AAIA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEO,MAAME,0BAA0B,GAAGA,CACxCC,WAA+C,EAC/CC,SAAyB,KACtB;EACH,MAAM;IAAEC,KAAK,EAAEC,cAAc;IAAEC,MAAM,EAAEC;EAAgB,CAAC,GACtD,IAAAC,gCAAmB,EAAC,CAAC;EACvB,MAAM;IAAEJ,KAAK;IAAEE;EAAO,CAAC,GAAG,IAAAG,sCAAkB,EAACP,WAAW,EAAEC,SAAS,CAAC;EAEpE,IACEC,KAAK,KAAK,CAAC,IACXE,MAAM,KAAK,CAAC,IACZD,cAAc,KAAK,CAAC,IACpBE,eAAe,KAAK,CAAC,EACrB;IACA,OAAOG,SAAS;EAClB;;EAEA;EACA;EACA,MAAMC,yBAAyB,GAAGC,IAAI,CAACC,GAAG,CAACR,cAAc,EAAEE,eAAe,CAAC;EAC3E,MAAMO,aAAa,GAAGH,yBAAyB,GAAG,IAAI;EAEtD,MAAMI,WAAW,GAAGX,KAAK,GAAGE,MAAM;EAClC,MAAMU,eAAe,GAAGD,WAAW,GAAG,CAAC;;EAEvC;EACA,IAAIC,eAAe,EAAE;IACnB,OAAO;MACLZ,KAAK,EAAEU,aAAa;MACpBR,MAAM,EAAEQ,aAAa,GAAGC;IAC1B,CAAC;EACH,CAAC,MAAM;IACL,OAAO;MACLX,KAAK,EAAEU,aAAa,GAAGC,WAAW;MAClCT,MAAM,EAAEQ;IACV,CAAC;EACH;AACF,CAAC;AAACG,OAAA,CAAAhB,0BAAA,GAAAA,0BAAA","ignoreList":[]}
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.version = void 0;
7
- const version = exports.version = '1.24.2';
7
+ const version = exports.version = '1.24.3';
8
8
  //# sourceMappingURL=version.js.map
@@ -74,7 +74,7 @@ export const FloatingParticipantView = ({
74
74
  'bottom-right': FloatingViewAlignment.bottomRight
75
75
  };
76
76
  const [containerDimensions, setContainerDimensions] = React.useState();
77
- const floatingVideoDimensions = useFloatingVideoDimensions(containerDimensions, participant, 'videoTrack');
77
+ const floatingVideoDimensions = useFloatingVideoDimensions(participant, 'videoTrack');
78
78
  const participantViewProps = {
79
79
  ParticipantLabel: null,
80
80
  ParticipantNetworkQualityIndicator,
@@ -1 +1 @@
1
- {"version":3,"names":["React","Pressable","StyleSheet","View","Z_INDEX","ComponentTestIds","VideoSlash","FloatingView","FloatingViewAlignment","ParticipantView","DefaultParticipantView","useTheme","useFloatingVideoDimensions","DefaultLocalParticipantViewVideoFallback","theme","colors","floatingParticipantsView","variants","iconSizes","defaults","createElement","style","styles","videoFallback","backgroundColor","sheetSecondary","height","md","width","color","iconPrimary","size","iconSize","FloatingParticipantView","alignment","onPressHandler","participant","participantViewStyle","draggableContainerStyle","ParticipantNetworkQualityIndicator","ParticipantVideoFallback","ParticipantReaction","VideoRenderer","supportedReactions","videoZOrder","objectFit","spacingSizes","floatingAlignmentMap","topLeft","topRight","bottomLeft","bottomRight","containerDimensions","setContainerDimensions","useState","floatingVideoDimensions","participantViewProps","ParticipantLabel","testID","LOCAL_PARTICIPANT","container","pointerEvents","onLayout","event","nativeEvent","layout","prev","containerHeight","containerWidth","initialAlignment","onPress","_extends","trackType","participantViewContainer","borderRadius","marginHorizontal","shadowColor","sheetPrimary","create","zIndex","IN_MIDDLE","flex","shadowOffset","shadowOpacity","shadowRadius","elevation","absoluteFillObject","alignItems","justifyContent"],"sourceRoot":"../../../../../src","sources":["components/Participant/FloatingParticipantView/index.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,SAAS,EAETC,UAAU,EACVC,IAAI,QAEC,cAAc;AACrB,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,OAAOC,YAAY,MAAM,gBAAgB;AAKzC,SAASC,qBAAqB,QAAQ,uBAAuB;AAC7D,SACEC,eAAe,IAAIC,sBAAsB,QAGpC,oBAAoB;AAC3B,SAASC,QAAQ,QAAQ,gCAAgC;AACzD,SAASC,0BAA0B,QAAQ,8BAA8B;;AAS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":["React","Pressable","StyleSheet","View","Z_INDEX","ComponentTestIds","VideoSlash","FloatingView","FloatingViewAlignment","ParticipantView","DefaultParticipantView","useTheme","useFloatingVideoDimensions","DefaultLocalParticipantViewVideoFallback","theme","colors","floatingParticipantsView","variants","iconSizes","defaults","createElement","style","styles","videoFallback","backgroundColor","sheetSecondary","height","md","width","color","iconPrimary","size","iconSize","FloatingParticipantView","alignment","onPressHandler","participant","participantViewStyle","draggableContainerStyle","ParticipantNetworkQualityIndicator","ParticipantVideoFallback","ParticipantReaction","VideoRenderer","supportedReactions","videoZOrder","objectFit","spacingSizes","floatingAlignmentMap","topLeft","topRight","bottomLeft","bottomRight","containerDimensions","setContainerDimensions","useState","floatingVideoDimensions","participantViewProps","ParticipantLabel","testID","LOCAL_PARTICIPANT","container","pointerEvents","onLayout","event","nativeEvent","layout","prev","containerHeight","containerWidth","initialAlignment","onPress","_extends","trackType","participantViewContainer","borderRadius","marginHorizontal","shadowColor","sheetPrimary","create","zIndex","IN_MIDDLE","flex","shadowOffset","shadowOpacity","shadowRadius","elevation","absoluteFillObject","alignItems","justifyContent"],"sourceRoot":"../../../../../src","sources":["components/Participant/FloatingParticipantView/index.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,SAAS,EAETC,UAAU,EACVC,IAAI,QAEC,cAAc;AACrB,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,OAAOC,YAAY,MAAM,gBAAgB;AAKzC,SAASC,qBAAqB,QAAQ,uBAAuB;AAC7D,SACEC,eAAe,IAAIC,sBAAsB,QAGpC,oBAAoB;AAC3B,SAASC,QAAQ,QAAQ,gCAAgC;AACzD,SAASC,0BAA0B,QAAQ,8BAA8B;;AASzE;AACA;AACA;;AA6BA,MAAMC,wCAAwC,GAAGA,CAAA,KAAM;EACrD,MAAM;IACJC,KAAK,EAAE;MACLC,MAAM;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AAe,GAChC1B,eAAe,iBACdT,KAAA,CAAAoB,aAAA,CAACX,eAAe,EAAA8D,QAAA;IACdnC,WAAW,EAAEA,WAAY;IACzBoC,SAAS,EAAC,YAAY;IACtBnD,KAAK,EAAE,CACLC,MAAM,CAACmD,wBAAwB,EAC/B;MACE7C,KAAK,EAAE2B,uBAAuB,CAAC3B,KAAK;MACpCF,MAAM,EAAE6B,uBAAuB,CAAC7B,MAAM;MACtCgD,YAAY,EAAEnB,uBAAuB,CAAC3B,KAAK,GAAG,GAAG;MACjD+C,gBAAgB,EAAE7B,YAAY,CAACnB;IACjC,CAAC,EACDU,oBAAoB,EACpB;MAAEuC,WAAW,EAAE7D,MAAM,CAAC8D;IAAa,CAAC,EACpC7D,wBAAwB,CAACyD,wBAAwB;IAEnD;IACA;IAAA;IACA7B,WAAW,EAAEA,WAAY;IACzBC,SAAS,EAAEA,SAAU;IACrBF,kBAAkB,EAAEA;EAAmB,GACnCa,oBAAoB,CACzB,CAEM,CACC,CAEZ,CAAC;AAEX,CAAC;AAED,MAAMlC,MAAM,GAAGpB,UAAU,CAAC4E,MAAM,CAAC;EAC/BlB,SAAS,EAAE;IACT;IACAmB,MAAM,EAAE3E,OAAO,CAAC4E,SAAS;IACzBC,IAAI,EAAE;EACR,CAAC;EACDR,wBAAwB,EAAE;IACxBS,YAAY,EAAE;MACZtD,KAAK,EAAE,CAAC;MACRF,MAAM,EAAE;IACV,CAAC;IACDyD,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE,IAAI;IAClBC,SAAS,EAAE;EACb,CAAC;EACD9D,aAAa,EAAE;IACb,GAAGrB,UAAU,CAACoF,kBAAkB;IAChCC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1,23 +1,36 @@
1
1
  import { useTrackDimensions } from '../../../hooks/useTrackDimensions';
2
- export const useFloatingVideoDimensions = (containerDimensions, participant, trackType) => {
3
- const containerWidth = containerDimensions?.width ?? 0;
2
+ import { useWindowDimensions } from 'react-native';
3
+ export const useFloatingVideoDimensions = (participant, trackType) => {
4
+ const {
5
+ width: containerWidth,
6
+ height: containerHeight
7
+ } = useWindowDimensions();
4
8
  const {
5
9
  width,
6
10
  height
7
11
  } = useTrackDimensions(participant, trackType);
8
- if (width === 0 || height === 0 || containerWidth === 0) {
12
+ if (width === 0 || height === 0 || containerWidth === 0 || containerHeight === 0) {
9
13
  return undefined;
10
14
  }
11
- const aspectRatio = width / height;
12
15
 
13
16
  // based on Android AOSP PiP mode default dimensions algorithm
14
- // 23% of the container width
15
- const floatingVideoWidth = containerWidth * 0.23;
16
- // the height is calculated based on the aspect ratio
17
- const floatingVideoHeight = floatingVideoWidth / aspectRatio;
18
- return {
19
- width: floatingVideoWidth,
20
- height: floatingVideoHeight
21
- };
17
+ // 23% of the shorter container dimension is the base dimension
18
+ const shorterContainerDimension = Math.min(containerWidth, containerHeight);
19
+ const baseDimension = shorterContainerDimension * 0.23;
20
+ const aspectRatio = width / height;
21
+ const isPortraitVideo = aspectRatio < 1;
22
+
23
+ // baseDimension is assigned to either height or width based on whether the video is landscape or portrait
24
+ if (isPortraitVideo) {
25
+ return {
26
+ width: baseDimension,
27
+ height: baseDimension / aspectRatio
28
+ };
29
+ } else {
30
+ return {
31
+ width: baseDimension * aspectRatio,
32
+ height: baseDimension
33
+ };
34
+ }
22
35
  };
23
36
  //# sourceMappingURL=useFloatingVideoDimensions.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useTrackDimensions","useFloatingVideoDimensions","containerDimensions","participant","trackType","containerWidth","width","height","undefined","aspectRatio","floatingVideoWidth","floatingVideoHeight"],"sourceRoot":"../../../../../src","sources":["components/Participant/FloatingParticipantView/useFloatingVideoDimensions.tsx"],"mappings":"AAIA,SAASA,kBAAkB,QAAQ,mCAAmC;AAEtE,OAAO,MAAMC,0BAA0B,GAAGA,CACxCC,mBAKa,EACbC,WAA+C,EAC/CC,SAAyB,KACtB;EACH,MAAMC,cAAc,GAAGH,mBAAmB,EAAEI,KAAK,IAAI,CAAC;EACtD,MAAM;IAAEA,KAAK;IAAEC;EAAO,CAAC,GAAGP,kBAAkB,CAACG,WAAW,EAAEC,SAAS,CAAC;EAEpE,IAAIE,KAAK,KAAK,CAAC,IAAIC,MAAM,KAAK,CAAC,IAAIF,cAAc,KAAK,CAAC,EAAE;IACvD,OAAOG,SAAS;EAClB;EAEA,MAAMC,WAAW,GAAGH,KAAK,GAAGC,MAAM;;EAElC;EACA;EACA,MAAMG,kBAAkB,GAAGL,cAAc,GAAG,IAAI;EAChD;EACA,MAAMM,mBAAmB,GAAGD,kBAAkB,GAAGD,WAAW;EAE5D,OAAO;IACLH,KAAK,EAAEI,kBAAkB;IACzBH,MAAM,EAAEI;EACV,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useTrackDimensions","useWindowDimensions","useFloatingVideoDimensions","participant","trackType","width","containerWidth","height","containerHeight","undefined","shorterContainerDimension","Math","min","baseDimension","aspectRatio","isPortraitVideo"],"sourceRoot":"../../../../../src","sources":["components/Participant/FloatingParticipantView/useFloatingVideoDimensions.tsx"],"mappings":"AAIA,SAASA,kBAAkB,QAAQ,mCAAmC;AACtE,SAASC,mBAAmB,QAAQ,cAAc;AAElD,OAAO,MAAMC,0BAA0B,GAAGA,CACxCC,WAA+C,EAC/CC,SAAyB,KACtB;EACH,MAAM;IAAEC,KAAK,EAAEC,cAAc;IAAEC,MAAM,EAAEC;EAAgB,CAAC,GACtDP,mBAAmB,CAAC,CAAC;EACvB,MAAM;IAAEI,KAAK;IAAEE;EAAO,CAAC,GAAGP,kBAAkB,CAACG,WAAW,EAAEC,SAAS,CAAC;EAEpE,IACEC,KAAK,KAAK,CAAC,IACXE,MAAM,KAAK,CAAC,IACZD,cAAc,KAAK,CAAC,IACpBE,eAAe,KAAK,CAAC,EACrB;IACA,OAAOC,SAAS;EAClB;;EAEA;EACA;EACA,MAAMC,yBAAyB,GAAGC,IAAI,CAACC,GAAG,CAACN,cAAc,EAAEE,eAAe,CAAC;EAC3E,MAAMK,aAAa,GAAGH,yBAAyB,GAAG,IAAI;EAEtD,MAAMI,WAAW,GAAGT,KAAK,GAAGE,MAAM;EAClC,MAAMQ,eAAe,GAAGD,WAAW,GAAG,CAAC;;EAEvC;EACA,IAAIC,eAAe,EAAE;IACnB,OAAO;MACLV,KAAK,EAAEQ,aAAa;MACpBN,MAAM,EAAEM,aAAa,GAAGC;IAC1B,CAAC;EACH,CAAC,MAAM;IACL,OAAO;MACLT,KAAK,EAAEQ,aAAa,GAAGC,WAAW;MAClCP,MAAM,EAAEM;IACV,CAAC;EACH;AACF,CAAC","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- export const version = '1.24.2';
1
+ export const version = '1.24.3';
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Participant/FloatingParticipantView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,KAAK,SAAS,EAGd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAKtB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,kCAAkC,EACxC,MAAM,YAAY,CAAC;AAEpB,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,EAC1B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEtE,MAAM,MAAM,gCAAgC,GACxC,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,CAAC;AAEnB;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,6BAA6B,GACtE,IAAI,CAAC,kCAAkC,EAAE,iBAAiB,CAAC,GAC3D,IAAI,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,GAC5C,IAAI,CAAC,oBAAoB,EAAE,WAAW,GAAG,aAAa,CAAC,GAAG;IACxD;;OAEG;IACH,SAAS,CAAC,EAAE,gCAAgC,CAAC;IAC7C;;OAEG;IACH,WAAW,CAAC,EAAE,sBAAsB,CAAC;IACrC;;OAEG;IACH,oBAAoB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5C;;;OAGG;IACH,uBAAuB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC/C;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AA2BJ;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,2PAcrC,4BAA4B,6BAsG9B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Participant/FloatingParticipantView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,KAAK,SAAS,EAGd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAKtB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,kCAAkC,EACxC,MAAM,YAAY,CAAC;AAEpB,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,EAC1B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEtE,MAAM,MAAM,gCAAgC,GACxC,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,CAAC;AAEnB;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,6BAA6B,GACtE,IAAI,CAAC,kCAAkC,EAAE,iBAAiB,CAAC,GAC3D,IAAI,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,GAC5C,IAAI,CAAC,oBAAoB,EAAE,WAAW,GAAG,aAAa,CAAC,GAAG;IACxD;;OAEG;IACH,SAAS,CAAC,EAAE,gCAAgC,CAAC;IAC7C;;OAEG;IACH,WAAW,CAAC,EAAE,sBAAsB,CAAC;IACrC;;OAEG;IACH,oBAAoB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5C;;;OAGG;IACH,uBAAuB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC/C;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AA2BJ;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,2PAcrC,4BAA4B,6BAqG9B,CAAC"}
@@ -1,8 +1,5 @@
1
1
  import { StreamVideoParticipant, VideoTrackType } from '@stream-io/video-client';
2
- export declare const useFloatingVideoDimensions: (containerDimensions: {
3
- width: number;
4
- height: number;
5
- } | undefined, participant: StreamVideoParticipant | undefined, trackType: VideoTrackType) => {
2
+ export declare const useFloatingVideoDimensions: (participant: StreamVideoParticipant | undefined, trackType: VideoTrackType) => {
6
3
  width: number;
7
4
  height: number;
8
5
  } | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"useFloatingVideoDimensions.d.ts","sourceRoot":"","sources":["../../../../../src/components/Participant/FloatingParticipantView/useFloatingVideoDimensions.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,cAAc,EACf,MAAM,yBAAyB,CAAC;AAGjC,eAAO,MAAM,0BAA0B,GACrC,qBACI;IACE,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,GACD,SAAS,EACb,aAAa,sBAAsB,GAAG,SAAS,EAC/C,WAAW,cAAc;;;aAqB1B,CAAC"}
1
+ {"version":3,"file":"useFloatingVideoDimensions.d.ts","sourceRoot":"","sources":["../../../../../src/components/Participant/FloatingParticipantView/useFloatingVideoDimensions.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,cAAc,EACf,MAAM,yBAAyB,CAAC;AAIjC,eAAO,MAAM,0BAA0B,GACrC,aAAa,sBAAsB,GAAG,SAAS,EAC/C,WAAW,cAAc;;;aAmC1B,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const version = "1.24.2";
1
+ export declare const version = "1.24.3";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -79,9 +79,11 @@ class StreamInCallManager: RCTEventEmitter {
79
79
  options: session.categoryOptions
80
80
  )
81
81
  configureAudioSession()
82
- // Enable wake lock to prevent the screen from dimming/locking during a call
82
+
83
83
  DispatchQueue.main.async {
84
+ // Enable wake lock to prevent the screen from dimming/locking during a call
84
85
  UIApplication.shared.isIdleTimerDisabled = true
86
+ // Register for audio route changes to turn off screen when earpiece is connected
85
87
  self.registerAudioRouteObserver()
86
88
  self.updateProximityMonitoring()
87
89
  self.log("Wake lock enabled (idle timer disabled)")
@@ -120,8 +122,10 @@ class StreamInCallManager: RCTEventEmitter {
120
122
  }
121
123
  // Disable wake lock and proximity when call manager stops so the device can sleep again
122
124
  DispatchQueue.main.async {
125
+ // Disable proximity monitoring to disable earpiece detection
123
126
  self.setProximityMonitoringEnabled(false)
124
127
  self.unregisterAudioRouteObserver()
128
+ // Disable wake lock to allow the screen to dim/lock again
125
129
  UIApplication.shared.isIdleTimerDisabled = false
126
130
  self.log("Wake lock disabled (idle timer enabled)")
127
131
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-native-sdk",
3
- "version": "1.24.2",
3
+ "version": "1.24.3",
4
4
  "description": "Stream Video SDK for React Native",
5
5
  "author": "https://getstream.io",
6
6
  "homepage": "https://getstream.io/video/docs/react-native/",
@@ -45,8 +45,8 @@
45
45
  "!**/.*"
46
46
  ],
47
47
  "dependencies": {
48
- "@stream-io/video-client": "1.36.0",
49
- "@stream-io/video-react-bindings": "1.10.4",
48
+ "@stream-io/video-client": "1.36.1",
49
+ "@stream-io/video-react-bindings": "1.11.0",
50
50
  "intl-pluralrules": "2.0.1",
51
51
  "lodash.merge": "^4.6.2",
52
52
  "react-native-url-polyfill": "^3.0.0",
@@ -128,7 +128,6 @@ export const FloatingParticipantView = ({
128
128
  }>();
129
129
 
130
130
  const floatingVideoDimensions = useFloatingVideoDimensions(
131
- containerDimensions,
132
131
  participant,
133
132
  'videoTrack',
134
133
  );
@@ -3,34 +3,43 @@ import {
3
3
  VideoTrackType,
4
4
  } from '@stream-io/video-client';
5
5
  import { useTrackDimensions } from '../../../hooks/useTrackDimensions';
6
+ import { useWindowDimensions } from 'react-native';
6
7
 
7
8
  export const useFloatingVideoDimensions = (
8
- containerDimensions:
9
- | {
10
- width: number;
11
- height: number;
12
- }
13
- | undefined,
14
9
  participant: StreamVideoParticipant | undefined,
15
10
  trackType: VideoTrackType,
16
11
  ) => {
17
- const containerWidth = containerDimensions?.width ?? 0;
12
+ const { width: containerWidth, height: containerHeight } =
13
+ useWindowDimensions();
18
14
  const { width, height } = useTrackDimensions(participant, trackType);
19
15
 
20
- if (width === 0 || height === 0 || containerWidth === 0) {
16
+ if (
17
+ width === 0 ||
18
+ height === 0 ||
19
+ containerWidth === 0 ||
20
+ containerHeight === 0
21
+ ) {
21
22
  return undefined;
22
23
  }
23
24
 
24
- const aspectRatio = width / height;
25
-
26
25
  // based on Android AOSP PiP mode default dimensions algorithm
27
- // 23% of the container width
28
- const floatingVideoWidth = containerWidth * 0.23;
29
- // the height is calculated based on the aspect ratio
30
- const floatingVideoHeight = floatingVideoWidth / aspectRatio;
26
+ // 23% of the shorter container dimension is the base dimension
27
+ const shorterContainerDimension = Math.min(containerWidth, containerHeight);
28
+ const baseDimension = shorterContainerDimension * 0.23;
31
29
 
32
- return {
33
- width: floatingVideoWidth,
34
- height: floatingVideoHeight,
35
- };
30
+ const aspectRatio = width / height;
31
+ const isPortraitVideo = aspectRatio < 1;
32
+
33
+ // baseDimension is assigned to either height or width based on whether the video is landscape or portrait
34
+ if (isPortraitVideo) {
35
+ return {
36
+ width: baseDimension,
37
+ height: baseDimension / aspectRatio,
38
+ };
39
+ } else {
40
+ return {
41
+ width: baseDimension * aspectRatio,
42
+ height: baseDimension,
43
+ };
44
+ }
36
45
  };
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '1.24.2';
1
+ export const version = '1.24.3';