Skip to content

fix(love): explain why screen sharing could not be started - #11129

Open
MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:fix/screen-share-denied-info
Open

MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:fix/screen-share-denied-info

Conversation

@MichaelUray

Copy link
Copy Markdown
Contributor

Fixes #5122

Problem and change

LiveKitClient.setScreenShareEnabled caught every error from starting a screen share and only logged it to the console. When the browser or the operating system blocked screen capture, or getDisplayMedia was not available (unsupported browser, insecure context), clicking the share button silently did nothing.

Classify the error in a small helper (getScreenShareErrorKind) and show a notification. Recognizable OS or permissions-policy denials, unsupported environments and other failures are shown as errors with a matching explanation. A plain NotAllowedError is reported by browsers both when the user closes the source picker and when capture is blocked, so it is shown as a soft informational hint asking the user to check the browser and OS permissions if they did not cancel. Add the new strings to all love-assets languages and a unit test for the helper.

Tests

New unit tests plugins/love-resources/src/__tests__/screenShareError.test.ts; test scripts added to the package so CI runs them. A real denial needs a media server and OS settings to reproduce: e.g. on macOS disable screen recording for the browser and click Share → an error notification; cancelling the picker shows a short informational hint (browsers report a cancel and a block with the same NotAllowedError).

LiveKitClient.setScreenShareEnabled caught every error from starting a screen share and only logged it to the console. When the browser or the operating system blocked screen capture, or getDisplayMedia was not available (unsupported browser, insecure context), clicking the share button silently did nothing.

Classify the error in a small helper (getScreenShareErrorKind) and show a notification. Recognizable OS or permissions-policy denials, unsupported environments and other failures are shown as errors with a matching explanation. A plain NotAllowedError is reported by browsers both when the user closes the source picker and when capture is blocked, so it is shown as a soft informational hint asking the user to check the browser and OS permissions if they did not cancel. Add the new strings to all love-assets languages and a unit test for the helper.

Fixes hcengineering#5122

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

Show information popup when screen sharing is disabled

1 participant