forked from react-native-camera/react-native-camera
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds react-native-windows UWP support (react-native-camera#862)
* Adds react-native-windows UWP support This adds basic support for capturing photos and videos from either the front or back panel cameras, with some support for video quality, orientation, etc. This also uses ZXing.Net to support barcode scanning from the video preview frames. It also supports torch and flash modes. Videos and photos saved to disk (or camera roll / temporary folder) also supports some file metadata (e.g., lat/long). There are a number of features that have not yet been implemented: - Support `playSoundOnCapture` for default shutter sounds - Add orientation metadata properties on photo / video files - Support all barcode formats in ZXing.Net - Additional file metadata (like description) - Photo quality settings with `quality` and `jpegQuality` - Image post-processing with `mirrorImage` and `fixOrientation` - Support event listeners for `onZoomChanged` & `onFocusChanged` - Device authorization checks as supported on iOS * Updating NuGet packages for RNCamera UWP project * Minor fixes for legacy RCTCamera implementation * hack(CameraForView): default camera to any when panel info not available
- Loading branch information
Showing
17 changed files
with
1,987 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
*AppPackages* | ||
*BundleArtifacts* | ||
*ReactAssets* | ||
|
||
#OS junk files | ||
[Tt]humbs.db | ||
*.DS_Store | ||
|
||
#Visual Studio files | ||
*.[Oo]bj | ||
*.user | ||
*.aps | ||
*.pch | ||
*.vspscc | ||
*.vssscc | ||
*_i.c | ||
*_p.c | ||
*.ncb | ||
*.suo | ||
*.tlb | ||
*.tlh | ||
*.bak | ||
*.[Cc]ache | ||
*.ilk | ||
*.log | ||
*.lib | ||
*.sbr | ||
*.sdf | ||
*.opensdf | ||
*.opendb | ||
*.unsuccessfulbuild | ||
ipch/ | ||
[Oo]bj/ | ||
[Bb]in | ||
[Dd]ebug*/ | ||
[Rr]elease*/ | ||
Ankh.NoLoad | ||
|
||
#MonoDevelop | ||
*.pidb | ||
*.userprefs | ||
|
||
#Tooling | ||
_ReSharper*/ | ||
*.resharper | ||
[Tt]est[Rr]esult* | ||
*.sass-cache | ||
|
||
#Project files | ||
[Bb]uild/ | ||
|
||
#Subversion files | ||
.svn | ||
|
||
# Office Temp Files | ||
~$* | ||
|
||
# vim Temp Files | ||
*~ | ||
|
||
#NuGet | ||
packages/ | ||
*.nupkg | ||
|
||
#ncrunch | ||
*ncrunch* | ||
*crunch*.local.xml | ||
|
||
# visual studio database projects | ||
*.dbmdl | ||
|
||
#Test files | ||
*.testsettings | ||
|
||
#Other files | ||
*.DotSettings | ||
.vs/ | ||
*project.lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
# Make sure we don't publish build artifacts to NPM | ||
ARM/ | ||
Debug/ | ||
x64/ | ||
x86/ | ||
bin/ | ||
obj/ | ||
.vs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.26730.3 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RNCamera", "RNCamera\RNCamera.csproj", "{F11038F0-88E5-11E7-BA7C-E36C7490591A}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReactNative", "..\node_modules\react-native-windows\ReactWindows\ReactNative\ReactNative.csproj", "{C7673AD5-E3AA-468C-A5FD-FA38154E205C}" | ||
EndProject | ||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ReactNative.Shared", "..\node_modules\react-native-windows\ReactWindows\ReactNative.Shared\ReactNative.Shared.shproj", "{EEA8B852-4D07-48E1-8294-A21AB5909FE5}" | ||
EndProject | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ChakraBridge", "..\node_modules\react-native-windows\ReactWindows\ChakraBridge\ChakraBridge.vcxproj", "{4B72C796-16D5-4E3A-81C0-3E36F531E578}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReactNativeWebViewBridge", "..\node_modules\react-native-windows\ReactWindows\ReactNativeWebViewBridge\ReactNativeWebViewBridge.csproj", "{7596216B-669C-41F8-86DA-F3637F6545C0}" | ||
EndProject | ||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Facebook.Yoga.Shared", "..\node_modules\react-native-windows\Yoga\csharp\Facebook.Yoga\Facebook.Yoga.Shared.shproj", "{91C42D32-291D-4B72-90B4-551663D60B8B}" | ||
EndProject | ||
Global | ||
GlobalSection(SharedMSBuildProjectFiles) = preSolution | ||
..\node_modules\react-native-windows\Yoga\csharp\Facebook.Yoga\Facebook.Yoga.Shared.projitems*{91c42d32-291d-4b72-90b4-551663d60b8b}*SharedItemsImports = 13 | ||
..\node_modules\react-native-windows\ReactWindows\ReactNative.Shared\ReactNative.Shared.projitems*{c7673ad5-e3aa-468c-a5fd-fa38154e205c}*SharedItemsImports = 4 | ||
..\node_modules\react-native-windows\Yoga\csharp\Facebook.Yoga\Facebook.Yoga.Shared.projitems*{c7673ad5-e3aa-468c-a5fd-fa38154e205c}*SharedItemsImports = 4 | ||
..\node_modules\react-native-windows\ReactWindows\ReactNative.Shared\ReactNative.Shared.projitems*{eea8b852-4d07-48e1-8294-a21ab5909fe5}*SharedItemsImports = 13 | ||
EndGlobalSection | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|ARM = Debug|ARM | ||
Debug|x64 = Debug|x64 | ||
Debug|x86 = Debug|x86 | ||
Development|ARM = Development|ARM | ||
Development|x64 = Development|x64 | ||
Development|x86 = Development|x86 | ||
Release|ARM = Release|ARM | ||
Release|x64 = Release|x64 | ||
Release|x86 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{F11038F0-88E5-11E7-BA7C-E36C7490591A}.Debug|ARM.ActiveCfg = Debug|ARM | ||
{F11038F0-88E5-11E7-BA7C-E36C7490591A}.Debug|ARM.Build.0 = Debug|ARM | ||
{F11038F0-88E5-11E7-BA7C-E36C7490591A}.Debug|x64.ActiveCfg = Debug|x64 | ||
{F11038F0-88E5-11E7-BA7C-E36C7490591A}.Debug|x64.Build.0 = Debug|x64 | ||
{F11038F0-88E5-11E7-BA7C-E36C7490591A}.Debug|x86.ActiveCfg = Debug|x86 | ||
{F11038F0-88E5-11E7-BA7C-E36C7490591A}.Debug|x86.Build.0 = Debug|x86 | ||
{F11038F0-88E5-11E7-BA7C-E36C7490591A}.Development|ARM.ActiveCfg = Development|ARM | ||
{F11038F0-88E5-11E7-BA7C-E36C7490591A}.Development|ARM.Build.0 = Development|ARM | ||
{F11038F0-88E5-11E7-BA7C-E36C7490591A}.Development|x64.ActiveCfg = Development|x64 | ||
{F11038F0-88E5-11E7-BA7C-E36C7490591A}.Development|x64.Build.0 = Development|x64 | ||
{F11038F0-88E5-11E7-BA7C-E36C7490591A}.Development|x86.ActiveCfg = Development|x86 | ||
{F11038F0-88E5-11E7-BA7C-E36C7490591A}.Development|x86.Build.0 = Development|x86 | ||
{F11038F0-88E5-11E7-BA7C-E36C7490591A}.Release|ARM.ActiveCfg = Release|ARM | ||
{F11038F0-88E5-11E7-BA7C-E36C7490591A}.Release|ARM.Build.0 = Release|ARM | ||
{F11038F0-88E5-11E7-BA7C-E36C7490591A}.Release|x64.ActiveCfg = Release|x64 | ||
{F11038F0-88E5-11E7-BA7C-E36C7490591A}.Release|x64.Build.0 = Release|x64 | ||
{F11038F0-88E5-11E7-BA7C-E36C7490591A}.Release|x86.ActiveCfg = Release|x86 | ||
{F11038F0-88E5-11E7-BA7C-E36C7490591A}.Release|x86.Build.0 = Release|x86 | ||
{C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Debug|ARM.ActiveCfg = Debug|ARM | ||
{C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Debug|ARM.Build.0 = Debug|ARM | ||
{C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Debug|x64.ActiveCfg = Debug|x64 | ||
{C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Debug|x64.Build.0 = Debug|x64 | ||
{C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Debug|x86.ActiveCfg = Debug|x86 | ||
{C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Debug|x86.Build.0 = Debug|x86 | ||
{C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Development|ARM.ActiveCfg = Debug|ARM | ||
{C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Development|ARM.Build.0 = Debug|ARM | ||
{C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Development|x64.ActiveCfg = Debug|x64 | ||
{C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Development|x64.Build.0 = Debug|x64 | ||
{C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Development|x86.ActiveCfg = Debug|x86 | ||
{C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Development|x86.Build.0 = Debug|x86 | ||
{C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Release|ARM.ActiveCfg = Release|ARM | ||
{C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Release|ARM.Build.0 = Release|ARM | ||
{C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Release|x64.ActiveCfg = Release|x64 | ||
{C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Release|x64.Build.0 = Release|x64 | ||
{C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Release|x86.ActiveCfg = Release|x86 | ||
{C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Release|x86.Build.0 = Release|x86 | ||
{4B72C796-16D5-4E3A-81C0-3E36F531E578}.Debug|ARM.ActiveCfg = Debug|ARM | ||
{4B72C796-16D5-4E3A-81C0-3E36F531E578}.Debug|ARM.Build.0 = Debug|ARM | ||
{4B72C796-16D5-4E3A-81C0-3E36F531E578}.Debug|x64.ActiveCfg = Debug|x64 | ||
{4B72C796-16D5-4E3A-81C0-3E36F531E578}.Debug|x64.Build.0 = Debug|x64 | ||
{4B72C796-16D5-4E3A-81C0-3E36F531E578}.Debug|x86.ActiveCfg = Debug|Win32 | ||
{4B72C796-16D5-4E3A-81C0-3E36F531E578}.Debug|x86.Build.0 = Debug|Win32 | ||
{4B72C796-16D5-4E3A-81C0-3E36F531E578}.Development|ARM.ActiveCfg = Debug|ARM | ||
{4B72C796-16D5-4E3A-81C0-3E36F531E578}.Development|ARM.Build.0 = Debug|ARM | ||
{4B72C796-16D5-4E3A-81C0-3E36F531E578}.Development|x64.ActiveCfg = Debug|x64 | ||
{4B72C796-16D5-4E3A-81C0-3E36F531E578}.Development|x64.Build.0 = Debug|x64 | ||
{4B72C796-16D5-4E3A-81C0-3E36F531E578}.Development|x86.ActiveCfg = Debug|Win32 | ||
{4B72C796-16D5-4E3A-81C0-3E36F531E578}.Development|x86.Build.0 = Debug|Win32 | ||
{4B72C796-16D5-4E3A-81C0-3E36F531E578}.Release|ARM.ActiveCfg = Release|ARM | ||
{4B72C796-16D5-4E3A-81C0-3E36F531E578}.Release|ARM.Build.0 = Release|ARM | ||
{4B72C796-16D5-4E3A-81C0-3E36F531E578}.Release|x64.ActiveCfg = Release|x64 | ||
{4B72C796-16D5-4E3A-81C0-3E36F531E578}.Release|x64.Build.0 = Release|x64 | ||
{4B72C796-16D5-4E3A-81C0-3E36F531E578}.Release|x86.ActiveCfg = Release|Win32 | ||
{4B72C796-16D5-4E3A-81C0-3E36F531E578}.Release|x86.Build.0 = Release|Win32 | ||
{7596216B-669C-41F8-86DA-F3637F6545C0}.Debug|ARM.ActiveCfg = Debug|ARM | ||
{7596216B-669C-41F8-86DA-F3637F6545C0}.Debug|ARM.Build.0 = Debug|ARM | ||
{7596216B-669C-41F8-86DA-F3637F6545C0}.Debug|x64.ActiveCfg = Debug|x64 | ||
{7596216B-669C-41F8-86DA-F3637F6545C0}.Debug|x64.Build.0 = Debug|x64 | ||
{7596216B-669C-41F8-86DA-F3637F6545C0}.Debug|x86.ActiveCfg = Debug|x86 | ||
{7596216B-669C-41F8-86DA-F3637F6545C0}.Debug|x86.Build.0 = Debug|x86 | ||
{7596216B-669C-41F8-86DA-F3637F6545C0}.Development|ARM.ActiveCfg = Debug|ARM | ||
{7596216B-669C-41F8-86DA-F3637F6545C0}.Development|ARM.Build.0 = Debug|ARM | ||
{7596216B-669C-41F8-86DA-F3637F6545C0}.Development|x64.ActiveCfg = Debug|x64 | ||
{7596216B-669C-41F8-86DA-F3637F6545C0}.Development|x64.Build.0 = Debug|x64 | ||
{7596216B-669C-41F8-86DA-F3637F6545C0}.Development|x86.ActiveCfg = Debug|x86 | ||
{7596216B-669C-41F8-86DA-F3637F6545C0}.Development|x86.Build.0 = Debug|x86 | ||
{7596216B-669C-41F8-86DA-F3637F6545C0}.Release|ARM.ActiveCfg = Release|ARM | ||
{7596216B-669C-41F8-86DA-F3637F6545C0}.Release|ARM.Build.0 = Release|ARM | ||
{7596216B-669C-41F8-86DA-F3637F6545C0}.Release|x64.ActiveCfg = Release|x64 | ||
{7596216B-669C-41F8-86DA-F3637F6545C0}.Release|x64.Build.0 = Release|x64 | ||
{7596216B-669C-41F8-86DA-F3637F6545C0}.Release|x86.ActiveCfg = Release|x86 | ||
{7596216B-669C-41F8-86DA-F3637F6545C0}.Release|x86.Build.0 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {B259F75D-E772-4C88-973E-F0EF45B3F422} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using ZXing; | ||
|
||
namespace RNCamera | ||
{ | ||
static class BarcodeFormatExtensions | ||
{ | ||
public static string GetName(this BarcodeFormat barcodeFormat) | ||
{ | ||
switch (barcodeFormat) | ||
{ | ||
case BarcodeFormat.AZTEC: | ||
return "aztec"; | ||
case BarcodeFormat.CODE_39: | ||
return "code39"; | ||
case BarcodeFormat.CODE_93: | ||
return "code93"; | ||
case BarcodeFormat.CODE_128: | ||
return "code128"; | ||
case BarcodeFormat.DATA_MATRIX: | ||
return "datamatrix"; | ||
case BarcodeFormat.EAN_8: | ||
return "ean8"; | ||
case BarcodeFormat.EAN_13: | ||
return "ean13"; | ||
case BarcodeFormat.ITF: | ||
return "interleaved2of5"; | ||
case BarcodeFormat.PDF_417: | ||
return "pdf417"; | ||
case BarcodeFormat.QR_CODE: | ||
return "qr"; | ||
case BarcodeFormat.UPC_E: | ||
return "upce"; | ||
default: | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.