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.

Aperta
#2,405 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Dart
Stelle
795
Fork
448
Merge medio
12h 19m
PR unite (30g)
14

Descrizione

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,
),
);

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.