Skip to content

fix(mobile): hide screen sharing in native webviews#23

Open
ScottShao wants to merge 1 commit into
BAWES-Universe:universefrom
ScottShao:feat/mobile-native-screenshare-compat
Open

fix(mobile): hide screen sharing in native webviews#23
ScottShao wants to merge 1 commit into
BAWES-Universe:universefrom
ScottShao:feat/mobile-native-screenshare-compat

Conversation

@ScottShao

Copy link
Copy Markdown

Related to #13
Related to #1
/claim #1

Summary

  • detect Capacitor native app context in the front-end via the existing browser/device utility layer
  • hide browser screen sharing when Universe is running inside the Android/iOS Capacitor shell so mobile users do not get a broken getDisplayMedia path
  • document screen sharing as the expected browser-only limitation in mobile/README.md while leaving camera/mic and iframe behavior unchanged
  • add a focused Vitest file that locks the native-app detection and screen-share support decision logic

Why this slice

This is a narrow follow-up from #13, not the full WebView compatibility issue. The goal is to handle the known mobile screen-share limitation cleanly without overlapping the already-open Android/iOS platform PRs (#21 and #22), the push work in #11, or the update flow in #12.

Verification

  • git diff --check
  • npm exec --workspace play -- prettier --check src/front/WebRtc/DeviceUtils.ts src/front/WebRtc/DeviceUtils.test.ts src/front/Stores/ScreenSharingStore.ts

Environment limitations

  • npm test --workspace play -- DeviceUtils.test.ts is currently blocked by the repo's Vite/Svelte setup on universe (vite.config.mts imports sveltePreprocess as a named export from the CommonJS svelte-preprocess package)
  • npm run typecheck --workspace play is also already failing on the current universe branch because generated @workadventure/messages protobuf outputs and related imports are missing from the workspace checkout
  • npm exec --workspace play -- eslint ... still reports the pre-existing import/no-unresolved problem for ../../i18n/i18n-svelte inside ScreenSharingStore.ts; this resolver issue exists on the branch independently of this slice

Demo

This slice has no visual asset change or native build artifact. The user-facing behavior change is that the screen-share control is no longer advertised inside the Capacitor mobile shell, and the README now documents that screen sharing remains browser-only on mobile.

@coderabbitai

coderabbitai Bot commented May 15, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@ScottShao has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 56 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c32dab44-163c-4376-b80c-018a59ff82c1

📥 Commits

Reviewing files that changed from the base of the PR and between e3106e7 and e538b77.

📒 Files selected for processing (4)
  • mobile/README.md
  • play/src/front/Stores/ScreenSharingStore.ts
  • play/src/front/WebRtc/DeviceUtils.test.ts
  • play/src/front/WebRtc/DeviceUtils.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant