From 21cb80ec881db9c30a0fdb834b33d2e74f728845 Mon Sep 17 00:00:00 2001 From: zyt-home <1058927970@qq.com> Date: Fri, 9 Apr 2021 23:55:53 +0800 Subject: [PATCH] Getting screen content can only be successful for the first time --- .../main/java/com/cloudwebrtc/webrtc/GetUserMediaImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/cloudwebrtc/webrtc/GetUserMediaImpl.java b/android/src/main/java/com/cloudwebrtc/webrtc/GetUserMediaImpl.java index c128a257ef..cc8fac0cce 100755 --- a/android/src/main/java/com/cloudwebrtc/webrtc/GetUserMediaImpl.java +++ b/android/src/main/java/com/cloudwebrtc/webrtc/GetUserMediaImpl.java @@ -471,7 +471,10 @@ protected void onReceiveResult(int requestCode, Bundle resultData) { new MediaProjection.Callback() { @Override public void onStop() { - resultError("MediaProjection.Callback()", "User revoked permission to capture the screen.", result); + super.onStop(); + // After Huawei P30 and Android 10 version test, the onstop method is called, which will not affect the next process, + // and there is no need to call the resulterror method + //resultError("MediaProjection.Callback()", "User revoked permission to capture the screen.", result); } }); if (videoCapturer == null) {