Open rimedinaif opened 2 months ago
Have you tried changing RTCAppGroupIdentifier
to your group id?
https://github.com/livekit/client-sdk-flutter/blob/main/example/ios/Runner/Info.plist#L7-L8
The main app and Broadcast-Extension actually communicate through the app group identifier
Yes, I already modified the Info.plist and added the group identifier to both the app and the extension
These two lines of code need to be removed. when you call getDisplayMedia
but do not use this screenVideoTrack, participant.setScreenShareEnabled will fail to enable screen sharing.
else {
ReplayKitChannel.startReplayKit();
await mediaDevices.getDisplayMedia({'deviceId': 'broadcast'});
}
This is the effective code to enable screen sharing
await room.localParticipant!.setScreenShareEnabled(true,
captureScreenAudio: false,
screenShareCaptureOptions:
const ScreenShareCaptureOptions(useiOSBroadcastExtension: true));
void _shareScreen() async {
await room.localParticipant!.setCameraEnabled(false);
if (defaultTargetPlatform == TargetPlatform.android) {
bool hasPermissions = await FlutterBackground.hasPermissions;
androidConfig = const FlutterBackgroundAndroidConfig(
notificationTitle: "Experty",
notificationText: "Experty sta condividendo lo schermo",
notificationImportance: AndroidNotificationImportance.Default,
notificationIcon:
AndroidResource(name: 'background_icon', defType: 'drawable'),
);
await FlutterBackground.initialize(androidConfig: androidConfig!);
await FlutterBackground.enableBackgroundExecution();
await Helper.requestCapturePermission();
// for android
await room.localParticipant!.setScreenShareEnabled(true);
} else if (defaultTargetPlatform == TargetPlatform.ios) {
// for iOS
await room.localParticipant!.setScreenShareEnabled(true,
captureScreenAudio: false,
screenShareCaptureOptions:
const ScreenShareCaptureOptions(useiOSBroadcastExtension: true));
}
setState(() {
isLocalScreenShared = !isLocalScreenShared;
});}
Describe the bug When trying to start screen sharing the system dialog is shown, but the screen recording never starts
https://github.com/user-attachments/assets/0476f493-05bd-4b9d-9a78-666994aa50d8
To Reproduce
SampleHandler.swift
SampleUploader.swift
SocketConnection.swift
DarwinNotificationCenter.swift
Atomic.swift
Expected behavior
Platform information
• No issues found!