fix: support setting iOS pip window sizes - #1876
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements support for setting iOS Picture-in-Picture (PiP) window sizes based on video track dimensions. Previously, the iOS PiP window size was determined by the OS, leading to inconsistent sizing. The solution tracks video dimensions from JavaScript and passes them to the native iOS layer to set appropriate PiP window sizes.
Key changes:
- Updates to
@stream-io/react-native-webrtcdependency from 125.4.0 to 125.4.1 across all packages - Enhanced
useTrackDimensionshook to better track video dimensions - New native iOS methods to handle PiP content size updates with caching mechanism
Reviewed Changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Multiple package.json files | Update @stream-io/react-native-webrtc dependency to version 125.4.1 |
| useTrackDimensions.ts | Improved dimension tracking logic and removed NativeModules dependency |
| RTCViewPipNative.tsx | Added function to send dimension updates to native layer |
| RTCViewPipIOS.tsx | Integrated dimension tracking with PiP component |
| RTCViewPipManager.swift | Added preferred content size setting with caching support |
| RTCViewPip.swift | Enhanced PiP view to handle cached size updates |
| StreamPictureInPictureController.swift | Added method to set preferred content size |
Comments suppressed due to low confidence (1)
packages/react-native-sdk/src/hooks/useTrackDimensions.ts:52
- Missing opening brace for the conditional block that should contain the return statement on line 51.
});
oliverlaz
approved these changes
Aug 4, 2025
santhoshvai
added a commit
that referenced
this pull request
Aug 5, 2025
### 💡 Overview Fixes a bug caused by #1876 There could be 0 participants when rendering RTCIOSPiP, this was not handled ### 📝 Implementation notes Added a null defaulter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Overview
iOS pip window did not know what size to set. And so size was set by the OS. This was not ideal as it seemed to completely random at times. In this PR we add support for PiP window size based on track size.
Untitled.mov
📝 Implementation notes
Sends track dimensions from JS to Native