10000 No need to set the video size for screen capture. · CodeStrings/flutter-webrtc@27ce809 · GitHub
[go: up one dir, main page]

Skip to content

Commit 27ce809

Browse files
committed
No need to set the video size for screen capture.
1 parent c65e948 commit 27ce809

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

android/src/main/java/com/cloudwebrtc/webrtc/GetUserMediaImpl.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -448,20 +448,6 @@ public void onStop() {
448448
SurfaceTextureHelper surfaceTextureHelper = SurfaceTextureHelper.create(threadName, EglUtils.getRootEglBaseContext());
449449
videoCapturer.initialize(surfaceTextureHelper, context, videoSource.getCapturerObserver());
450450

451-
// Fall back to defaults if keys are missing.
452-
int width
453-
= videoConstraintsMandatory2.hasKey("minWidth")
454-
? videoConstraintsMandatory2.getInt("minWidth")
455-
: DEFAULT_WIDTH;
456-
int height
457-
= videoConstraintsMandatory2.hasKey("minHeight")
458-
? videoConstraintsMandatory2.getInt("minHeight")
459-
: DEFAULT_HEIGHT;
460-
int fps
461-
= videoConstraintsMandatory2.hasKey("minFrameRate")
462-
? videoConstraintsMandatory2.getInt("minFrameRate")
463-
: DEFAULT_FPS;
464-
465451
WindowManager wm = (WindowManager) applicationContext
466452
.getSystemService(Context.WINDOW_SERVICE);
467453

example/lib/src/get_display_media_sample.dart

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,8 @@ class _GetDisplayMediaSampleState extends State<GetDisplayMediaSample> {
4747
// Platform messages are asynchronous, so we initialize in an async method.
4848
_makeCall() async {
4949
final Map<String, dynamic> mediaConstraints = {
50-
"audio": true,
51-
"video": {
52-
"mandatory": {
53-
"minWidth":'1280', // Provide your own width, height and frame rate here
54-
"minHeight": '720',
55-
"minFrameRate": '30',
56-
},
57-
"facingMode": "user",
58-
"optional": [],
59-
}
50+
"audio": false,
51+
"video": true
6052
};
6153

6254
try {

0 commit comments

Comments
 (0)
0