Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
#14 Cannot read code_128 barcodes in iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Apr 9, 2016
1 parent fb0a4f8 commit c067303
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
bin/
.classpath
.project
.idea
*.iml
local.properties
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?><plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="com.phonegap.plugins.barcodescanner"
version="2.0.0">
version="2.0.1">

<name>BarcodeScanner</name>
<description>You can use the BarcodeScanner plugin to scan different types of barcodes (using the device's camera) and get the metadata encoded in them for processing within your application.</description>
Expand Down
12 changes: 7 additions & 5 deletions src/ios/CDVBarcodeScanner.mm
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,14 @@ - (NSString*)setUpCaptureSession {

[output setSampleBufferDelegate:self queue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0)];

if (![captureSession canSetSessionPreset:AVCaptureSessionPresetMedium]) {
return @"unable to preset medium quality video capture";
if ([captureSession canSetSessionPreset:AVCaptureSessionPresetHigh]) {
captureSession.sessionPreset = AVCaptureSessionPresetHigh;
} else if ([captureSession canSetSessionPreset:AVCaptureSessionPresetMedium]) {
captureSession.sessionPreset = AVCaptureSessionPresetMedium;
} else {
return @"unable to preset high nor medium quality video capture";
}

captureSession.sessionPreset = AVCaptureSessionPresetMedium;


if ([captureSession canAddInput:input]) {
[captureSession addInput:input];
}
Expand Down

0 comments on commit c067303

Please sign in to comment.