Skip to content
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

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

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

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

appsmall opened this issue Jan 22, 2025 · 4 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.

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

3 participants