-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
ios screen sharing #12249
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
base: master
Are you sure you want to change the base?
ios screen sharing #12249
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR integrates iOS screen sharing and audio capture support into the existing server, scrap, and Flutter layers. Key changes include:
- Added an iOS-specific audio service implementation in
audio_service.rs. - Extended the
scraplibrary with an iOS FFI and native ReplayKit-based capture. - Updated Flutter UI and model code to handle iOS permissions, settings, and conditionals.
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/server/audio_service.rs | Added #[cfg(target_os = "ios")] audio service |
| src/platform/ios.rs | New stubs for platform-level iOS APIs |
| libs/scrap/src/lib.rs | Enabled scrap::ios module |
| libs/scrap/src/ios/ffi.rs | FFI layer with callback and polling buffer |
| flutter/lib/mobile/pages/settings_page.dart | Conditional UI tweaks for Android/iOS |
| flutter/lib/mobile/pages/server_page.dart | Calls to checkIOSPermission, updated notification text |
| flutter/lib/models/server_model.dart | checkIOSPermission and _restartServiceForAudio |
| showServerSettings(gFFI.dialogManager); | ||
| }), | ||
| if (!isIOS && !_hideNetwork && !_hideProxy) | ||
| if (!_hideNetwork && !_hideProxy) |
Copilot
AI
Jul 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proxy settings section no longer excludes iOS, causing proxy options to appear on iOS where they should be hidden. Reinstate an isAndroid guard or add an isIOS exclusion to prevent iOS from showing proxy UI.
| crossAxisAlignment: CrossAxisAlignment.start, | ||
| children: [ | ||
| Text(translate("android_start_service_tip"), | ||
| Text(translate(isAndroid ? "android_start_service_tip" : "Start screen sharing service"), |
Copilot
AI
Jul 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The fallback string for iOS is a hard-coded literal rather than a translation key. Consider adding a localized key for consistency and future translations.
| Text(translate(isAndroid ? "android_start_service_tip" : "Start screen sharing service"), | |
| Text(translate(isAndroid ? "android_start_service_tip" : "ios_start_service_tip"), |
| } | ||
|
|
||
| lazy_static::lazy_static! { | ||
| static ref TEMP_BUFFER: Mutex<Vec<u8>> = Mutex::new(vec![0u8; 4096 * 2160 * 4]); |
Copilot
AI
Jul 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fallback buffer is statically sized for 4Kx2K RGBA and may be insufficient or wasteful for other resolutions. Consider resizing or reallocating the buffer based on actual get_display_info() dimensions to avoid over-allocating or truncated frames.
| static ref TEMP_BUFFER: Mutex<Vec<u8>> = Mutex::new(vec![0u8; 4096 * 2160 * 4]); | |
| static ref TEMP_BUFFER: Mutex<Vec<u8>> = { | |
| let (width, height) = get_display_info(); | |
| Mutex::new(vec![0u8; (width * height * 4) as usize]) | |
| }; |
| } | ||
|
|
||
| /// Check iOS permissions for screen recording and microphone | ||
| checkIOSPermission() async { |
Copilot
AI
Jul 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The async method has no explicit return type. For clarity and type safety, declare it as Future<void> checkIOSPermission() async { ... }.
| checkIOSPermission() async { | |
| Future<void> checkIOSPermission() async { |
|
This merge need check because it make basic issues |
No description provided.