Skip to content

Conversation

@daimoc
Copy link
Contributor

@daimoc daimoc commented Sep 19, 2025

Hi,
Since the recent local recording modifications, local recording no longer works in embedded iframes, even if the iframe and parent page are served from the same domain.

When running inside an iframe, setCaptureHandle and getCaptureHandle do not work, resulting in a WrongSurfaceSelected error.

This patch relaxes the capture handle validation to ensure local recording continues to work when the service is embedded in an iframe from the same domain.

With this change:

  • The capture handle validation (isBrowser + matchesHandle) is applied only if supportsCaptureHandle is true.
  • In iframe contexts where the capture handle is not available, the validation is skipped, allowing recording to work properly.

Additionally, since getDisplayMedia is already called with:
preferCurrentTab: true,
surfaceSwitching: 'exclude',
it might be worth considering whether the explicit surface validation is still needed at all.

Best Regards,
Damien Fetis

…ding

Skip capture handle validation when inside an iframe to ensure local
recording works. This only applies if the iframe is served from the
same domain.
@jitsi-jenkins
Copy link

Hi, thanks for your contribution!
If you haven't already done so, could you please make sure you sign our CLA (https://jitsi.org/icla for individuals and https://jitsi.org/ccla for corporations)? We would unfortunately be unable to merge your patch unless we have that piece :(.

@saghul
Copy link
Member

saghul commented Sep 19, 2025

Than you for taking the time to submit this!

I thought the problem was the file write handle, is that not a problem in an iframe?

If that works, brilliant!

@daimoc
Copy link
Contributor Author

daimoc commented Sep 19, 2025

You’re correct — the file write handle is still a problem when the iframe and parent frame are on different domains. Unfortunately, I haven’t found a solution for that yet.

This patch only addresses the same-domain (or proxied) iframe case, where local recording was broken due to the capture handle validation. Cross-domain embedding remains unsupported because of the file handle limitation.

@saghul
Copy link
Member

saghul commented Sep 19, 2025

I see! I had forgotten about the cross-domain aspect of it.

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.

3 participants