Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e535f7a

Browse files
committed
Add codecov.yml file
1 parent b0005df commit e535f7a

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

codecov.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
coverage:
2+
status:
3+
patch:
4+
default:
5+
target: 80.0
6+

webrtc-android-framework/src/main/java/io/antmedia/webrtcandroidframework/WebRTCClient.java

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,6 @@ public void init(String url, String streamId, String mode, String token, Intent
233233

234234
iceServers.add(new PeerConnection.IceServer(stunServerUri));
235235

236-
237-
238236
if (remoteRendererList != null) {
239237
int size = remoteRendererList.size();
240238
for (int i = 0; i < size; i++)
@@ -495,6 +493,21 @@ public void startScreenCapture() {
495493
}
496494
}
497495

496+
@TargetApi(21)
497+
private @Nullable VideoCapturer createScreenCapturer() {
498+
if (mediaProjectionPermissionResultCode != Activity.RESULT_OK) {
499+
reportError("User didn't give permission to capture the screen.");
500+
return null;
501+
}
502+
return new ScreenCapturerAndroid(mediaProjection,
503+
mediaProjectionPermissionResultData, new MediaProjection.Callback() {
504+
@Override
505+
public void onStop() {
506+
reportError("User revoked permission to capture the screen.");
507+
}
508+
});
509+
}
510+
498511

499512
public void onActivityResult(int requestCode, int resultCode, Intent data) {
500513
if (requestCode != CallActivity.CAPTURE_PERMISSION_REQUEST_CODE)
@@ -566,21 +579,6 @@ public void setOpenFrontCamera(boolean openFrontCamera) {
566579
return null;
567580
}
568581

569-
@TargetApi(21)
570-
private @Nullable VideoCapturer createScreenCapturer() {
571-
if (mediaProjectionPermissionResultCode != Activity.RESULT_OK) {
572-
reportError("User didn't give permission to capture the screen.");
573-
return null;
574-
}
575-
return new ScreenCapturerAndroid(mediaProjection,
576-
mediaProjectionPermissionResultData, new MediaProjection.Callback() {
577-
@Override
578-
public void onStop() {
579-
reportError("User revoked permission to capture the screen.");
580-
}
581-
});
582-
}
583-
584582
@Override
585583
public void stopVideoSource() {
586584
activityRunning = false;
@@ -851,8 +849,6 @@ public void changeVideoSource(String newSource) {
851849
} else if (SOURCE_REAR.equals(source)) {
852850
openFrontCamera = false;
853851
}
854-
855-
856852
if (source.equals(SOURCE_FILE)) {
857853
String videoFileAsCamera = this.intent.getStringExtra(CallActivity.EXTRA_VIDEO_FILE_AS_CAMERA);
858854
try {

webrtc-android-sample-app/src/main/java/io/antmedia/webrtc_android_sample_app/ScreenCaptureActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data)
132132
// If the device version is v29 or higher, screen sharing will work service due to media projection policy.
133133
// Otherwise media projection will work without service
134134
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q){
135+
135136
MediaProjectionService service = new MediaProjectionService();
136137

137138
service.setListener(mediaProjection -> {

0 commit comments

Comments
 (0)