-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[camera_android_camerax] Implement enableAudio
for video recording
#9264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
3c852de
cca1467
3cc6ad3
8a0edb9
bd0a0e1
f52f501
5b8f2ce
827f83c
5e5cf84
2d65185
ba2a945
a49d337
578521b
9ac1356
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
|
||
package io.flutter.plugins.camerax; | ||
|
||
import android.Manifest; | ||
import android.content.pm.PackageManager; | ||
import androidx.annotation.NonNull; | ||
import androidx.camera.video.PendingRecording; | ||
import androidx.camera.video.Recording; | ||
|
@@ -25,6 +27,19 @@ public ProxyApiRegistrar getPigeonRegistrar() { | |
return (ProxyApiRegistrar) super.getPigeonRegistrar(); | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public PendingRecording withAudioEnabled(PendingRecording pigeonInstance, boolean initialMuted) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to clarify, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lol yeah it's confusing. I made this mirror |
||
if (!initialMuted | ||
&& ContextCompat.checkSelfPermission( | ||
getPigeonRegistrar().getContext(), Manifest.permission.RECORD_AUDIO) | ||
== PackageManager.PERMISSION_GRANTED) { | ||
return pigeonInstance.withAudioEnabled(false); | ||
} | ||
|
||
return pigeonInstance.withAudioEnabled(true); | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public Recording start( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lintOptions
is deprecated!