Commit Graph

13 Commits

Author SHA1 Message Date
Marc Rousavy
4781ad9835
feat: Continue to record audio when receiving a phone call (try to prevent interruptions) (#1278)
* feat: Continue to record audio when receiving a phone call (try to prevent interruptions)

Uses `setPrefersNoInterruptionsFromSystemAlerts` to prevent system alerts (like phone calls) from interrupting the audio session which records audio from the microphone.

* fix: Add `try`
2022-10-14 12:30:22 +02:00
Marc Rousavy
9301430165 chore: Lint 2021-12-10 09:44:54 +01:00
Marc Rousavy
ad5e131f6a
feat: frameProcessorFps="auto" and automatic performance suggestions (throttle or increase FPS) (#393)
* Add `onFrameProcessorPerformanceSuggestionAvailable` and make `frameProcessorFps` support `auto`

* Implement performance suggestion and auto-adjusting

* Fix FPS setting, evaluate correctly

* Floor suggested FPS

* Remove `console.log` for frame drop warnings.

* Swift format

* Use `30` magic number

* only call if FPS is different

* Update CameraView.swift

* Implement Android 1/2

* Cleanup

* Update `frameProcessorFps` if available

* Optimize `FrameProcessorPerformanceDataCollector` initialization

* Cache call

* Set frameProcessorFps directly (Kotlin setter)

* Don't suggest if same value

* Call suggestion every second

* reset time on set

* Always store 15 last samples

* reset counter too

* Update FrameProcessorPerformanceDataCollector.swift

* Update CameraView+RecordVideo.swift

* Update CameraView.kt

* iOS: Redesign evaluation

* Update CameraView+RecordVideo.swift

* Android: Redesign evaluation

* Update CameraView.kt

* Update REA to latest alpha and install RNScreens

* Fix frameProcessorFps updating
2021-09-06 16:27:16 +02:00
Marc Rousavy
16f2a7cdec
chore: Cleanup void returns (#187)
* Place `return` in `return [void]` on separate line

* format

* Update CameraView+RecordVideo.swift

* f
2021-06-09 11:14:49 +02:00
Marc Rousavy
72a1fad78e
feat: Separate usecases (decouple microphone, video, photo) (#168)
* Add props

* add props (iOS)

* Add use-cases conditionally

* Update CameraView+RecordVideo.swift

* Update RecordingSession.swift

* reconfigure on change

* Throw correct errors

* Check for audio permission

* Move `#if` outward

* Throw appropriate errors

* Update CameraView+RecordVideo.swift

* fix Splashscreen

* Dynamic filePath

* Fix video extension

* add `avci` and `m4v` file types

* Fix RecordVideo errors

* Fix audio setup

* Enable `photo`, `video` and `audio`

* Check for `video={true}` in frameProcessor

* format

* Remove unused DispatchQueue

* Update docs

* Add `supportsPhotoAndVideoCapture`

* Fix view manager

* Fix error not being propagated

* Catch normal errors too

* Update DEVICES.mdx

* Update CAPTURING.mdx

* Update classdocs
2021-06-07 13:08:40 +02:00
Marc Rousavy
eeb765f018
fix: Move Audio Input initialization shortly before startRecording (#159)
* rename

* Update AVAudioSession+updateCategory.swift

* fix bootstrap script

* Update CameraView+AVAudioSession.swift

* move audio input adding lower

* Activate AudioSession only when starting recording

* format

* Deactivate Audio Session

* remove audio input before deactivating audio session

* Update CameraView+AVAudioSession.swift

* log time

* Update CameraView+AVAudioSession.swift

* measure time with `measureElapsedTime`

* Update project.pbxproj

* only log in debug builds

* bootstrap with bridge (RNN new API)

* Mark two funcs as `@inlinable`

* format

* Update ReactLogger.swift

* Make audioWriter optional (allow videos without sound)

* only log frame drop reason in DEBUG

* Make audio writing entirely optional

* format

* Use function name as label for measureElapsedTime

* Update MeasureElapsedTime.swift

* Update MeasureElapsedTime.swift

* Mark AudioWriter as finished

* set `automaticallyConfiguresApplicationAudioSession` once

* Add JS console logging

* log to JS console for a few logs

* Update AVAudioSession+updateCategory.swift

* format

* Update JSConsoleHelper.mm

* catch log errors

* Update ReactLogger.swift

* fix docs

* Update RecordingSession.swift

* Immediatelly add audio input

* Update CameraView+AVCaptureSession.swift

* Update CameraView+AVCaptureSession.swift

* Update ReactLogger.swift

* immediatelly set audio session

* extract

* format

* Update TROUBLESHOOTING.mdx

* hmm

* Update AVAudioSession+updateCategory.swift

* Create secondary `AVCaptureSession` for audio

* Configure once, start stop on demand

* format

* fix audio notification interruptions

* docs
2021-06-03 14:16:02 +02:00
Marc Rousavy
71730a73ef
fix: Fix AVAudioSession not allowing background music playback (#155)
* Set category always if different

* rename org

* Fix video format sorting

* fix format filtering

* Update AVAudioSession+setCategoryIfNotSet.swift

* upgrade all dependencies

* Also run dependabot for JS codebase

* Update MediaPage.tsx

* Use typescript 4.2.4

* Also run TS in check-all

* Downgrade typescript to 4.2.3

* f

* recreate lockfiles

* docs: Revert package.json changes

* revert all package.json changes

* Update Podfile.lock

* bump all dependencies, pin typescript to 4.2.4

* Downgrade react-native-navigation for now

* upgrade to later snapshot

* Update yarn.lock

* remove yeet
2021-06-01 13:07:57 +02:00
Marc Rousavy
4ea636e0d0
Automatically handle Audio interruptions (#113)
* Remove audio device when interruption begins

* Remove ReactLogger:alsoLogToJS

* Fix ReactLogger.logJS calls

* Fix `AVCaptureSessionInterruptionReasonKey` cast
2021-03-29 14:12:04 +02:00
Marc Rousavy
cd180dc73b Set automaticallyConfiguresApplicationAudioSession = false 2021-03-29 13:18:02 +02:00
Marc Rousavy
8825a54342 Fix automatically configures application audio session 2021-03-29 11:43:01 +02:00
Marc Rousavy
1558dd2f15
Error when Audio Input is in use by another app (#111)
* Remove Audio Device if it failed to configure

* Add `audio-in-use-by-other-app` error

* Try removing on interruption

* Format code

* Make error more clear
2021-03-29 11:32:00 +02:00
Marc Rousavy
b25cf6a04f Refactor lifecycle vars 2021-03-26 16:28:08 +01:00
Marc Rousavy
9404b93dc3 Extract AVCaptureSession and AVAudioSession setup to extensions 2021-03-26 16:20:57 +01:00