Capacitor Camera : No Camera Found

My app should allow users to upload pictures from gallery. However, if I try to take a picture while another app is using the camera (like MS Teams), the app throws a No Camera Found message and .

so, is there a way to detect if another app is using the camera for an ionic app?