Skip to content

How to Support for both local and remote video in PiP mode? #558

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

Open
appsmall opened this issue Jan 22, 2025 · 5 comments
Open

How to Support for both local and remote video in PiP mode? #558

appsmall opened this issue Jan 22, 2025 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@appsmall
Copy link

We need to implement Picture-in-Picture (PiP) support for displaying both local and remote videos simultaneously.

@appsmall appsmall added the enhancement New feature or request label Jan 22, 2025
@hiroshihorie
Copy link
Member

I think you will need to compose 2 streams of CMSampleBuffers into a single view.

@appsmall
Copy link
Author

Could you please provide an example?

@hiroshihorie
Copy link
Member

Hi @appsmall , sorry but I'm occupied at the moment. I hope to make this simple for developers.

I need to check:

  • Does Apple's PIP spec support multiple AVSampleBufferDisplayLayer ? If yes, this will make it easier since we just need to layout the views to your preference, then push the CMSampleBuffers from the VideoRenderer protocol.
  • If not, we need to process and combine the buffers to create a single source of CMSampleBuffers to render to a single AVSampleBufferDisplayLayer.

@ladvoc
Copy link
Contributor

ladvoc commented Feb 3, 2025

Hi @appsmall, you might want to explore the new init(activeVideoCallSourceView:contentViewController:) API for creating your content source. This update lets you supply a UIView for the PiP window instead of being limited to a single AVSampleBufferDisplayLayer, so you can lay out both side by side. Apple’s documentation includes a guide on how to use this API.

@bennnjamin
Copy link

@ladvoc @appsmall Have either of you had success using init(activeVideoCallSourceView:contentViewController:)? The linked guide is very brief and does not outline any specific requirements about the UIView other than it must contain the content of the video call. With Apple's historical limitations on background camera access, I suspect there are some undocumented requirements about the UIView because I have been unable to find any working example out there.

If anyone has more insight into this newer PiP API please share here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants