react-native-camera-kit icon indicating copy to clipboard operation
react-native-camera-kit copied to clipboard

I turn off camera shutter sound but it not working

Open minkgkyaw9899 opened this issue 2 years ago • 2 comments

Describe the bug In Camera component I give shutterPhotoSound props to false value but it not working.

To Reproduce

Expected behavior I want to fix shutterPhotoSound props is working well

Screenshots Screenshot 2024-01-31 at 10 15 44 AM

Desktop (please complete the following information):

  • OS: Mac Os
  • Browser chrome
  • Version 14.3 (Sonoma)

Smartphone (please complete the following information):

  • Device: Redmi Note 12 Turbo
  • OS: MIUI
  • Browser Chrome
  • Version 14.0.27

Additional context I have been tested in other phone like Samsung note 10+ and also same issues.

minkgkyaw9899 avatar Jan 31 '24 03:01 minkgkyaw9899

facing same issue

JuEunSung avatar Feb 15 '24 08:02 JuEunSung

The code only adds a sound if true, it doesn't remove it if false

https://github.com/teslamotors/react-native-camera-kit/blob/master/android/src/main/java/com/rncamerakit/CKCamera.kt#L401

if (shutterPhotoSound) {
    val audio = getActivity().getSystemService(Context.AUDIO_SERVICE) as AudioManager
    if (audio.ringerMode == AudioManager.RINGER_MODE_NORMAL) {
        MediaActionSound().play(MediaActionSound.SHUTTER_CLICK)
    }
}

You can try to do something along the line of

} else if (camera?.cameraInfo?.canDisableShutterSound == true) {
    camera.enableShutterSound(false)
}

DavidBertet avatar Feb 19 '24 03:02 DavidBertet

I am unable to reproduce with it set to ={false} or omitting it, with v14.1.0 of the library, so closing this for now.

scarlac avatar Nov 16 '24 01:11 scarlac