You confused me there for a moment with the "front camera" as an iMac only has a front camera.
Give this a try: boot into Safe Mode according to How to use safe mode on your Mac and test to see if the problem persists. Reboot normally and test again.
NOTE: Safe Mode boot can take up to 3 - 5 minutes as it's doing the following;
• Verifies your startup disk and attempts to repair directory issues, if needed
• Loads only required kernel extensions (prevents 3rd party kernel/extensions from loading)
• Prevents Startup Items and Login Items from opening automatically
• Disables user-installed fonts
• Deletes font caches, kernel cache, and other system cache files
Don't know about the iPad, maybe a hard reboot.