AgoraIO-Extensions / AgoraIO-Extensions/Agora-Flutter-SDK

In register event handler, there is screen capture error request (onPermissionError) but screen capture permission granted(onPermissionGranted) something like this does not exist.

Đang mở
#2,405 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Dart
Star
795
Fork
448
Merge trung bình
12 giờ 19 phút
Pull request đã merge (30 ngày)
14

Mô tả

When a user click the cross button of popup requisition opens after screen capture started - it goes into onPermissionError.

1. How do we listen to, if user tap somewhere else or if user grant permission?
2. what if user takes no action on the popup, the code should wait for the appropriate user permission.

late RtcEngine engine;

await engine.startScreenCapture(
ScreenCaptureParameters2(
audioParams: ScreenAudioParameters(
sampleRate: 44100,
channels: 2,
captureSignalVolume: 100,
),
captureAudio: true,
captureVideo: true,
videoParams: ScreenVideoParameters(
dimensions: VideoDimensions(
width: (size.width * pixelRatio).toInt(),
height: (size.height * pixelRatio).toInt(),
),
frameRate: 30,
bitrate: 2260,
),
),
);

// it should wait for the user permission/action
engine.registerEventHandler(
RtcEngineEventHandler(
onPermissionError: (errCode) async {
debugPrint("Screen capture permission denied: $errCode");
if (context.mounted) Navigator.pop(context);
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
SystemChrome.setPreferredOrientations(DeviceOrientation.values);
return;
},
),
);

print("Screen capture started");

await engine.joinChannel(
token: AgoraConstants.tokenTemp,
channelId: _channelName,
uid: 123456789,
options: ChannelMediaOptions(
publishCustomVideoTrack: true,
customVideoTrackId: _customTrackId ?? 0,
publishMicrophoneTrack: true,
),
);

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.