@arfuhad/react-native-smart-camera 0.1.2 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +75 -3
- package/README.md +259 -206
- package/android/build.gradle +14 -39
- package/android/src/main/java/com/smartcamera/FaceDetectorFrameProcessorPlugin.kt +324 -0
- package/android/src/main/java/com/smartcamera/SmartCameraPackage.kt +28 -0
- package/build/detection/blinkProcessor.js +2 -1
- package/build/detection/blinkProcessor.js.map +1 -1
- package/build/detection/faceDetector.d.ts +4 -4
- package/build/detection/faceDetector.d.ts.map +1 -1
- package/build/detection/faceDetector.js +31 -11
- package/build/detection/faceDetector.js.map +1 -1
- package/build/detection/index.d.ts +1 -1
- package/build/detection/index.d.ts.map +1 -1
- package/build/detection/index.js +1 -1
- package/build/detection/index.js.map +1 -1
- package/build/detection/staticImageDetector.d.ts +11 -11
- package/build/detection/staticImageDetector.d.ts.map +1 -1
- package/build/detection/staticImageDetector.js +19 -23
- package/build/detection/staticImageDetector.js.map +1 -1
- package/build/hooks/index.d.ts +6 -0
- package/build/hooks/index.d.ts.map +1 -1
- package/build/hooks/index.js +8 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/useBlinkDetection.d.ts +27 -16
- package/build/hooks/useBlinkDetection.d.ts.map +1 -1
- package/build/hooks/useBlinkDetection.js +63 -37
- package/build/hooks/useBlinkDetection.js.map +1 -1
- package/build/hooks/useFaceDetection.js +3 -2
- package/build/hooks/useFaceDetection.js.map +1 -1
- package/build/hooks/useFaceDetector.d.ts +123 -0
- package/build/hooks/useFaceDetector.d.ts.map +1 -0
- package/build/hooks/useFaceDetector.js +133 -0
- package/build/hooks/useFaceDetector.js.map +1 -0
- package/build/hooks/useSmartCamera.js.map +1 -1
- package/build/hooks/useSmartCameraWebRTC.d.ts +3 -5
- package/build/hooks/useSmartCameraWebRTC.d.ts.map +1 -1
- package/build/hooks/useSmartCameraWebRTC.js +19 -87
- package/build/hooks/useSmartCameraWebRTC.js.map +1 -1
- package/build/hooks/useWebRTC.d.ts +88 -0
- package/build/hooks/useWebRTC.d.ts.map +1 -0
- package/build/hooks/useWebRTC.js +394 -0
- package/build/hooks/useWebRTC.js.map +1 -0
- package/build/hooks/useWebRTCWithDetection.d.ts +89 -0
- package/build/hooks/useWebRTCWithDetection.d.ts.map +1 -0
- package/build/hooks/useWebRTCWithDetection.js +131 -0
- package/build/hooks/useWebRTCWithDetection.js.map +1 -0
- package/build/index.d.ts +24 -10
- package/build/index.d.ts.map +1 -1
- package/build/index.js +38 -13
- package/build/index.js.map +1 -1
- package/build/types.d.ts +28 -12
- package/build/types.d.ts.map +1 -1
- package/build/types.js.map +1 -1
- package/build/utils/index.js.map +1 -1
- package/build/webrtc/WebRTCBridge.d.ts +3 -0
- package/build/webrtc/WebRTCBridge.d.ts.map +1 -1
- package/build/webrtc/WebRTCBridge.js +12 -15
- package/build/webrtc/WebRTCBridge.js.map +1 -1
- package/build/webrtc/WebRTCManager.d.ts +148 -0
- package/build/webrtc/WebRTCManager.d.ts.map +1 -0
- package/build/webrtc/WebRTCManager.js +383 -0
- package/build/webrtc/WebRTCManager.js.map +1 -0
- package/build/webrtc/index.d.ts +3 -1
- package/build/webrtc/index.d.ts.map +1 -1
- package/build/webrtc/index.js +5 -0
- package/build/webrtc/index.js.map +1 -1
- package/build/webrtc/types.d.ts +212 -4
- package/build/webrtc/types.d.ts.map +1 -1
- package/build/webrtc/types.js +34 -1
- package/build/webrtc/types.js.map +1 -1
- package/ios/FaceDetectorFrameProcessorPlugin.m +11 -0
- package/ios/FaceDetectorFrameProcessorPlugin.swift +304 -0
- package/package.json +11 -11
- package/react-native-smart-camera.podspec +32 -0
- package/src/detection/blinkProcessor.ts +127 -0
- package/src/detection/faceDetector.ts +78 -0
- package/src/detection/index.ts +3 -0
- package/src/detection/staticImageDetector.ts +53 -0
- package/src/hooks/index.ts +26 -0
- package/src/hooks/useBlinkDetection.ts +127 -0
- package/src/hooks/useFaceDetection.ts +105 -0
- package/src/hooks/useFaceDetector.ts +191 -0
- package/src/hooks/useSmartCamera.ts +83 -0
- package/src/hooks/useSmartCameraWebRTC.ts +120 -0
- package/src/hooks/useWebRTC.ts +453 -0
- package/src/hooks/useWebRTCWithDetection.ts +181 -0
- package/src/index.ts +170 -0
- package/src/types.ts +636 -0
- package/src/utils/index.ts +355 -0
- package/src/webrtc/WebRTCBridge.ts +127 -0
- package/src/webrtc/WebRTCManager.ts +453 -0
- package/src/webrtc/index.ts +50 -0
- package/src/webrtc/types.ts +361 -0
- package/android/build/.transforms/e0a0b120a9ccc3a8de4f5784bc36b161/results.bin +0 -1
- package/android/build/.transforms/e0a0b120a9ccc3a8de4f5784bc36b161/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/generated/source/buildConfig/debug/expo/modules/smartcamera/BuildConfig.java +0 -10
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -7
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -6
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
- package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/java_res/debug/out/META-INF/arfuhad-react-native-smart-camera_debug.kotlin_module +0 -0
- package/android/build/intermediates/javac/debug/classes/expo/modules/smartcamera/BuildConfig.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +0 -2
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -7
- package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -7
- package/android/build/intermediates/navigation_json/debug/navigation.json +0 -1
- package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +0 -1
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -16
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/arfuhad-react-native-smart-camera_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/DetectedFace.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/FaceBounds.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/FaceContoursData.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/FaceDetectionOptions.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/FaceLandmarksData.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/ImageLoader$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/ImageLoader$loadImage$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/ImageLoader.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/MLKitFaceDetector$detectFaces$2$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/MLKitFaceDetector$detectFaces$2$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/MLKitFaceDetector.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/MLKitFaceDetectorKt$sam$com_google_android_gms_tasks_OnSuccessListener$0.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/MLKitFaceDetectorKt.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/PointData.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$1$1$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$1$3$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$1$4$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunction$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunction$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunction$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$4.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$Function$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$Function$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$Function$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$Function$4.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$FunctionWithoutArgs$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$FunctionWithoutArgs$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$OnActivityEntersBackground$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$OnActivityEntersForeground$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$OnDestroy$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraView.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/WebRTCFrameBridge$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/WebRTCFrameBridge.class +0 -0
- package/android/src/main/java/expo/modules/smartcamera/ImageLoader.kt +0 -106
- package/android/src/main/java/expo/modules/smartcamera/MLKitFaceDetector.kt +0 -273
- package/android/src/main/java/expo/modules/smartcamera/SmartCameraModule.kt +0 -205
- package/android/src/main/java/expo/modules/smartcamera/SmartCameraView.kt +0 -153
- package/android/src/main/java/expo/modules/smartcamera/WebRTCFrameBridge.kt +0 -184
- package/build/SmartCamera.d.ts +0 -17
- package/build/SmartCamera.d.ts.map +0 -1
- package/build/SmartCamera.js +0 -270
- package/build/SmartCamera.js.map +0 -1
- package/build/SmartCameraModule.d.ts +0 -112
- package/build/SmartCameraModule.d.ts.map +0 -1
- package/build/SmartCameraModule.js +0 -121
- package/build/SmartCameraModule.js.map +0 -1
- package/build/SmartCameraView.d.ts +0 -8
- package/build/SmartCameraView.d.ts.map +0 -1
- package/build/SmartCameraView.js +0 -7
- package/build/SmartCameraView.js.map +0 -1
- package/expo-module.config.json +0 -9
- package/ios/MLKitFaceDetector.swift +0 -310
- package/ios/SmartCamera.podspec +0 -33
- package/ios/SmartCameraModule.swift +0 -225
- package/ios/SmartCameraView.swift +0 -146
- package/ios/WebRTCFrameBridge.swift +0 -150
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSmartCamera.js","sourceRoot":"","sources":["../../src/hooks/useSmartCamera.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAG1F;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAe,OAAO,CAAC,CAAC;IAC1E,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAC5F,MAAM,YAAY,GAAG,eAAe,CAAC,aAAa,CAAC,CAAC;IAEpD,6CAA6C;IAC7C,MAAM,MAAM,GAA6B,OAAO,CAAC,GAAG,EAAE;QACpD,IAAI,CAAC,YAAY;YAAE,OAAO,SAAS,CAAC;QAEpC,OAAO;YACL,EAAE,EAAE,YAAY,CAAC,EAAE;YACnB,IAAI,EAAE,YAAY,CAAC,IAAI;YACvB,QAAQ,EAAE,YAAY,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;YAC9D,QAAQ,EAAE,YAAY,CAAC,QAAQ;YAC/B,QAAQ,EAAE,YAAY,CAAC,QAAQ;YAC/B,qBAAqB,EAAE,YAAY,CAAC,qBAAqB;SAC1D,CAAC;IACJ,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,4BAA4B;IAC5B,MAAM,iBAAiB,GAAG,WAAW,CAAC,KAAK,IAAsB,EAAE;QACjE,MAAM,MAAM,GAAG,MAAM,uBAAuB,EAAE,CAAC;QAC/C,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,CAAC,uBAAuB,CAAC,CAAC,CAAC;IAE9B,uCAAuC;IACvC,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE;QACpC,gBAAgB,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACpE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,aAAa;QACb,iBAAiB;QACjB,MAAM;QACN,YAAY;QACZ,aAAa;KACd,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB;IACvC,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,yBAAyB,EAAE,CAAC;IAEzD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC9B,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,QAAQ,EAAE,MAAM,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;QACxD,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,qBAAqB,EAAE,MAAM,CAAC,qBAAqB;KACpD,CAAC,CAAC,CAAC;AACN,CAAC"
|
|
1
|
+
{"version":3,"file":"useSmartCamera.js","sourceRoot":"","sources":["../../src/hooks/useSmartCamera.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAG1F;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAe,OAAO,CAAC,CAAC;IAC1E,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAC5F,MAAM,YAAY,GAAG,eAAe,CAAC,aAAa,CAAC,CAAC;IAEpD,6CAA6C;IAC7C,MAAM,MAAM,GAA6B,OAAO,CAAC,GAAG,EAAE;QACpD,IAAI,CAAC,YAAY;YAAE,OAAO,SAAS,CAAC;QAEpC,OAAO;YACL,EAAE,EAAE,YAAY,CAAC,EAAE;YACnB,IAAI,EAAE,YAAY,CAAC,IAAI;YACvB,QAAQ,EAAE,YAAY,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;YAC9D,QAAQ,EAAE,YAAY,CAAC,QAAQ;YAC/B,QAAQ,EAAE,YAAY,CAAC,QAAQ;YAC/B,qBAAqB,EAAE,YAAY,CAAC,qBAAqB;SAC1D,CAAC;IACJ,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,4BAA4B;IAC5B,MAAM,iBAAiB,GAAG,WAAW,CAAC,KAAK,IAAsB,EAAE;QACjE,MAAM,MAAM,GAAG,MAAM,uBAAuB,EAAE,CAAC;QAC/C,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,CAAC,uBAAuB,CAAC,CAAC,CAAC;IAE9B,uCAAuC;IACvC,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE;QACpC,gBAAgB,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACpE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,aAAa;QACb,iBAAiB;QACjB,MAAM;QACN,YAAY;QACZ,aAAa;KACd,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB;IACvC,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,yBAAyB,EAAE,CAAC;IAEzD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC9B,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,QAAQ,EAAE,MAAM,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;QACxD,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,qBAAqB,EAAE,MAAM,CAAC,qBAAqB;KACpD,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -13,8 +13,8 @@ export interface UseSmartCameraWebRTCOptions extends Omit<WebRTCConfig, 'enabled
|
|
|
13
13
|
/**
|
|
14
14
|
* Hook for managing WebRTC streaming with SmartCamera
|
|
15
15
|
*
|
|
16
|
-
* This
|
|
17
|
-
*
|
|
16
|
+
* NOTE: This is a stub implementation. WebRTC functionality is not yet implemented.
|
|
17
|
+
* The hook provides the interface but does not perform actual streaming.
|
|
18
18
|
*
|
|
19
19
|
* @param options - WebRTC configuration options
|
|
20
20
|
* @returns WebRTC streaming controls and state
|
|
@@ -42,9 +42,7 @@ export interface UseSmartCameraWebRTCOptions extends Omit<WebRTCConfig, 'enabled
|
|
|
42
42
|
*
|
|
43
43
|
* return (
|
|
44
44
|
* <View>
|
|
45
|
-
* <
|
|
46
|
-
* webrtc={{ enabled: isStreaming, peerConnection, mode: 'call' }}
|
|
47
|
-
* />
|
|
45
|
+
* <Camera device={device} isActive={true} />
|
|
48
46
|
* <Button
|
|
49
47
|
* onPress={isStreaming ? stopStreaming : startStreaming}
|
|
50
48
|
* title={isStreaming ? 'End Call' : 'Start Call'}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSmartCameraWebRTC.d.ts","sourceRoot":"","sources":["../../src/hooks/useSmartCameraWebRTC.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"useSmartCameraWebRTC.d.ts","sourceRoot":"","sources":["../../src/hooks/useSmartCameraWebRTC.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEvF;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC;IAChF,8CAA8C;IAC9C,aAAa,CAAC,EAAE,YAAY,CAAC;IAE7B,4CAA4C;IAC5C,sBAAsB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IAExD,oCAAoC;IACpC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,GAAE,2BAAgC,GACxC,0BAA0B,CA0D5B"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { useState, useCallback, useRef, useEffect } from 'react';
|
|
2
|
-
import { initializeWebRTC, startWebRTCStream, stopWebRTCStream, addWebRTCStateChangeListener, } from '../SmartCameraModule';
|
|
3
2
|
/**
|
|
4
3
|
* Hook for managing WebRTC streaming with SmartCamera
|
|
5
4
|
*
|
|
6
|
-
* This
|
|
7
|
-
*
|
|
5
|
+
* NOTE: This is a stub implementation. WebRTC functionality is not yet implemented.
|
|
6
|
+
* The hook provides the interface but does not perform actual streaming.
|
|
8
7
|
*
|
|
9
8
|
* @param options - WebRTC configuration options
|
|
10
9
|
* @returns WebRTC streaming controls and state
|
|
@@ -32,9 +31,7 @@ import { initializeWebRTC, startWebRTCStream, stopWebRTCStream, addWebRTCStateCh
|
|
|
32
31
|
*
|
|
33
32
|
* return (
|
|
34
33
|
* <View>
|
|
35
|
-
* <
|
|
36
|
-
* webrtc={{ enabled: isStreaming, peerConnection, mode: 'call' }}
|
|
37
|
-
* />
|
|
34
|
+
* <Camera device={device} isActive={true} />
|
|
38
35
|
* <Button
|
|
39
36
|
* onPress={isStreaming ? stopStreaming : startStreaming}
|
|
40
37
|
* title={isStreaming ? 'End Call' : 'Start Call'}
|
|
@@ -45,19 +42,16 @@ import { initializeWebRTC, startWebRTCStream, stopWebRTCStream, addWebRTCStateCh
|
|
|
45
42
|
* ```
|
|
46
43
|
*/
|
|
47
44
|
export function useSmartCameraWebRTC(options = {}) {
|
|
48
|
-
const {
|
|
45
|
+
const { initialCamera = 'front', onStreamingStateChange, onError, } = options;
|
|
49
46
|
const [videoTrack, setVideoTrack] = useState(null);
|
|
50
47
|
const [isStreaming, setIsStreaming] = useState(false);
|
|
51
|
-
const [isInitialized, setIsInitialized] = useState(false);
|
|
52
48
|
const [currentCamera, setCurrentCamera] = useState(initialCamera);
|
|
53
|
-
const peerConnectionRef = useRef(peerConnection);
|
|
54
49
|
const callbacksRef = useRef({ onStreamingStateChange, onError });
|
|
55
50
|
const isMounted = useRef(true);
|
|
56
51
|
// Keep refs updated
|
|
57
52
|
useEffect(() => {
|
|
58
|
-
peerConnectionRef.current = peerConnection;
|
|
59
53
|
callbacksRef.current = { onStreamingStateChange, onError };
|
|
60
|
-
}, [
|
|
54
|
+
}, [onStreamingStateChange, onError]);
|
|
61
55
|
// Track mounted state
|
|
62
56
|
useEffect(() => {
|
|
63
57
|
isMounted.current = true;
|
|
@@ -65,90 +59,28 @@ export function useSmartCameraWebRTC(options = {}) {
|
|
|
65
59
|
isMounted.current = false;
|
|
66
60
|
};
|
|
67
61
|
}, []);
|
|
68
|
-
//
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
const subscription = addWebRTCStateChangeListener((state) => {
|
|
71
|
-
if (isMounted.current) {
|
|
72
|
-
setIsStreaming(state.isStreaming);
|
|
73
|
-
callbacksRef.current.onStreamingStateChange?.(state.isStreaming);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
return () => {
|
|
77
|
-
subscription.remove();
|
|
78
|
-
};
|
|
79
|
-
}, []);
|
|
80
|
-
// Initialize WebRTC on first use
|
|
81
|
-
const ensureInitialized = useCallback(async () => {
|
|
82
|
-
if (isInitialized)
|
|
83
|
-
return;
|
|
84
|
-
try {
|
|
85
|
-
await initializeWebRTC();
|
|
86
|
-
if (isMounted.current) {
|
|
87
|
-
setIsInitialized(true);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
catch (error) {
|
|
91
|
-
const err = error instanceof Error ? error : new Error(String(error));
|
|
92
|
-
callbacksRef.current.onError?.(err);
|
|
93
|
-
throw err;
|
|
94
|
-
}
|
|
95
|
-
}, [isInitialized]);
|
|
96
|
-
// Start streaming
|
|
62
|
+
// Start streaming (stub)
|
|
97
63
|
const startStreaming = useCallback(async () => {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
width: videoConstraints.width ?? 1280,
|
|
104
|
-
height: videoConstraints.height ?? 720,
|
|
105
|
-
frameRate: videoConstraints.frameRate ?? 30,
|
|
106
|
-
});
|
|
107
|
-
if (isMounted.current) {
|
|
108
|
-
setIsStreaming(true);
|
|
109
|
-
callbacksRef.current.onStreamingStateChange?.(true);
|
|
110
|
-
}
|
|
64
|
+
var _a, _b;
|
|
65
|
+
console.warn('[SmartCamera] WebRTC streaming is not yet implemented');
|
|
66
|
+
if (isMounted.current) {
|
|
67
|
+
setIsStreaming(true);
|
|
68
|
+
(_b = (_a = callbacksRef.current).onStreamingStateChange) === null || _b === void 0 ? void 0 : _b.call(_a, true);
|
|
111
69
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
callbacksRef.current.onError?.(err);
|
|
115
|
-
throw err;
|
|
116
|
-
}
|
|
117
|
-
}, [videoConstraints, ensureInitialized]);
|
|
118
|
-
// Stop streaming
|
|
70
|
+
}, []);
|
|
71
|
+
// Stop streaming (stub)
|
|
119
72
|
const stopStreaming = useCallback(() => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
callbacksRef.current.onStreamingStateChange?.(false);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
catch (error) {
|
|
129
|
-
const err = error instanceof Error ? error : new Error(String(error));
|
|
130
|
-
callbacksRef.current.onError?.(err);
|
|
73
|
+
var _a, _b;
|
|
74
|
+
if (isMounted.current) {
|
|
75
|
+
setVideoTrack(null);
|
|
76
|
+
setIsStreaming(false);
|
|
77
|
+
(_b = (_a = callbacksRef.current).onStreamingStateChange) === null || _b === void 0 ? void 0 : _b.call(_a, false);
|
|
131
78
|
}
|
|
132
79
|
}, []);
|
|
133
|
-
// Switch camera
|
|
80
|
+
// Switch camera
|
|
134
81
|
const switchCamera = useCallback(() => {
|
|
135
82
|
setCurrentCamera((prev) => (prev === 'front' ? 'back' : 'front'));
|
|
136
|
-
// The camera switch will be handled by the SmartCamera component
|
|
137
|
-
// when the camera prop changes
|
|
138
83
|
}, []);
|
|
139
|
-
// Cleanup on unmount
|
|
140
|
-
useEffect(() => {
|
|
141
|
-
return () => {
|
|
142
|
-
if (isStreaming) {
|
|
143
|
-
try {
|
|
144
|
-
stopWebRTCStream();
|
|
145
|
-
}
|
|
146
|
-
catch {
|
|
147
|
-
// Ignore cleanup errors
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
}, [isStreaming]);
|
|
152
84
|
return {
|
|
153
85
|
videoTrack,
|
|
154
86
|
isStreaming,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSmartCameraWebRTC.js","sourceRoot":"","sources":["../../src/hooks/useSmartCameraWebRTC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useSmartCameraWebRTC.js","sourceRoot":"","sources":["../../src/hooks/useSmartCameraWebRTC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAiBjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,UAAU,oBAAoB,CAClC,UAAuC,EAAE;IAEzC,MAAM,EACJ,aAAa,GAAG,OAAO,EACvB,sBAAsB,EACtB,OAAO,GACR,GAAG,OAAO,CAAC;IAEZ,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAA0B,IAAI,CAAC,CAAC;IAC5E,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAe,aAAa,CAAC,CAAC;IAEhF,MAAM,YAAY,GAAG,MAAM,CAAC,EAAE,sBAAsB,EAAE,OAAO,EAAE,CAAC,CAAC;IACjE,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAE/B,oBAAoB;IACpB,SAAS,CAAC,GAAG,EAAE;QACb,YAAY,CAAC,OAAO,GAAG,EAAE,sBAAsB,EAAE,OAAO,EAAE,CAAC;IAC7D,CAAC,EAAE,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC,CAAC;IAEtC,sBAAsB;IACtB,SAAS,CAAC,GAAG,EAAE;QACb,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;QACzB,OAAO,GAAG,EAAE;YACV,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,yBAAyB;IACzB,MAAM,cAAc,GAAG,WAAW,CAAC,KAAK,IAAmB,EAAE;;QAC3D,OAAO,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;QAEtE,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC;YACtB,cAAc,CAAC,IAAI,CAAC,CAAC;YACrB,MAAA,MAAA,YAAY,CAAC,OAAO,EAAC,sBAAsB,mDAAG,IAAI,CAAC,CAAC;QACtD,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,wBAAwB;IACxB,MAAM,aAAa,GAAG,WAAW,CAAC,GAAS,EAAE;;QAC3C,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC;YACtB,aAAa,CAAC,IAAI,CAAC,CAAC;YACpB,cAAc,CAAC,KAAK,CAAC,CAAC;YACtB,MAAA,MAAA,YAAY,CAAC,OAAO,EAAC,sBAAsB,mDAAG,KAAK,CAAC,CAAC;QACvD,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,gBAAgB;IAChB,MAAM,YAAY,GAAG,WAAW,CAAC,GAAS,EAAE;QAC1C,gBAAgB,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACpE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,UAAU;QACV,WAAW;QACX,cAAc;QACd,aAAa;QACb,YAAY;KACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useWebRTC Hook
|
|
3
|
+
*
|
|
4
|
+
* React hook for managing WebRTC video calling with peer connections,
|
|
5
|
+
* local/remote streams, and signaling integration.
|
|
6
|
+
*
|
|
7
|
+
* This hook provides all the functionality needed for 1-to-1 video calls.
|
|
8
|
+
* Users are responsible for implementing their own signaling mechanism
|
|
9
|
+
* (WebSocket, Socket.io, etc.) to exchange SDP offers/answers and ICE candidates.
|
|
10
|
+
*/
|
|
11
|
+
import type { UseWebRTCOptions, UseWebRTCResult } from '../webrtc/types';
|
|
12
|
+
/**
|
|
13
|
+
* Hook for WebRTC video calling
|
|
14
|
+
*
|
|
15
|
+
* @param options - Configuration options
|
|
16
|
+
* @returns WebRTC controls and state
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* import { useWebRTC } from '@arfuhad/react-native-smart-camera';
|
|
21
|
+
* import { RTCView } from 'react-native-webrtc';
|
|
22
|
+
*
|
|
23
|
+
* function VideoCall() {
|
|
24
|
+
* const {
|
|
25
|
+
* localStream,
|
|
26
|
+
* remoteStream,
|
|
27
|
+
* callState,
|
|
28
|
+
* startLocalStream,
|
|
29
|
+
* createPeerConnection,
|
|
30
|
+
* createOffer,
|
|
31
|
+
* setRemoteDescription,
|
|
32
|
+
* addIceCandidate,
|
|
33
|
+
* onIceCandidate,
|
|
34
|
+
* switchCamera,
|
|
35
|
+
* toggleAudio,
|
|
36
|
+
* toggleVideo,
|
|
37
|
+
* cleanup,
|
|
38
|
+
* } = useWebRTC({
|
|
39
|
+
* config: {
|
|
40
|
+
* iceServers: [{ urls: 'stun:stun.l.google.com:19302' }],
|
|
41
|
+
* },
|
|
42
|
+
* onRemoteStream: (stream) => console.log('Remote stream received'),
|
|
43
|
+
* });
|
|
44
|
+
*
|
|
45
|
+
* // Start a call
|
|
46
|
+
* const startCall = async () => {
|
|
47
|
+
* await startLocalStream();
|
|
48
|
+
* createPeerConnection();
|
|
49
|
+
* const offer = await createOffer();
|
|
50
|
+
* // Send offer via your signaling server
|
|
51
|
+
* socket.emit('offer', offer);
|
|
52
|
+
* };
|
|
53
|
+
*
|
|
54
|
+
* // Handle incoming call
|
|
55
|
+
* useEffect(() => {
|
|
56
|
+
* socket.on('offer', async (offer) => {
|
|
57
|
+
* await startLocalStream();
|
|
58
|
+
* createPeerConnection();
|
|
59
|
+
* await setRemoteDescription(offer);
|
|
60
|
+
* const answer = await createAnswer();
|
|
61
|
+
* socket.emit('answer', answer);
|
|
62
|
+
* });
|
|
63
|
+
*
|
|
64
|
+
* socket.on('ice-candidate', (candidate) => {
|
|
65
|
+
* addIceCandidate(candidate);
|
|
66
|
+
* });
|
|
67
|
+
*
|
|
68
|
+
* onIceCandidate((event) => {
|
|
69
|
+
* if (event.candidate) {
|
|
70
|
+
* socket.emit('ice-candidate', event.candidate);
|
|
71
|
+
* }
|
|
72
|
+
* });
|
|
73
|
+
* }, []);
|
|
74
|
+
*
|
|
75
|
+
* return (
|
|
76
|
+
* <View>
|
|
77
|
+
* {remoteStream && <RTCView streamURL={remoteStream.toURL()} />}
|
|
78
|
+
* {localStream && <RTCView streamURL={localStream.toURL()} />}
|
|
79
|
+
* <Button onPress={switchCamera} title="Switch Camera" />
|
|
80
|
+
* <Button onPress={toggleAudio} title="Mute/Unmute" />
|
|
81
|
+
* </View>
|
|
82
|
+
* );
|
|
83
|
+
* }
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export declare function useWebRTC(options?: UseWebRTCOptions): UseWebRTCResult;
|
|
87
|
+
export type { UseWebRTCOptions, UseWebRTCResult };
|
|
88
|
+
//# sourceMappingURL=useWebRTC.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWebRTC.d.ts","sourceRoot":"","sources":["../../src/hooks/useWebRTC.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EAQhB,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,gBAAqB,GAAG,eAAe,CA2VzE;AAED,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC"}
|