Skip to content

fix: support setting iOS pip window sizes #1876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 4, 2025
Merged

fix: support setting iOS pip window sizes #1876

merged 2 commits into from
Aug 4, 2025

Conversation

santhoshvai
Copy link
Member

@santhoshvai santhoshvai commented Aug 4, 2025

💡 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

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-webrtc dependency from 125.4.0 to 125.4.1 across all packages
  • Enhanced useTrackDimensions hook 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.
        });

@santhoshvai santhoshvai merged commit 2c553c9 into main Aug 4, 2025
17 checks passed
@santhoshvai santhoshvai deleted the ios-pip-sizes branch August 4, 2025 14:29
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants