You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ti...@apache.org on 2020/07/04 17:55:18 UTC
[cordova-plugin-media-capture] 01/01: refactor(eslint): use
cordova-eslint /w fix
This is an automated email from the ASF dual-hosted git repository.
timbru31 pushed a commit to branch feat/eslint
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-media-capture.git
commit a1329b3c317f6197db10757a76bc5cfbdaf8b419
Author: Tim Brust <gi...@timbrust.de>
AuthorDate: Sat Jul 4 19:54:30 2020 +0200
refactor(eslint): use cordova-eslint /w fix
---
.eslintrc.yml | 31 ++-
package.json | 12 +-
src/browser/CaptureProxy.js | 126 ++++++------
src/windows/CaptureProxy.js | 467 ++++++++++++++++++++++++++++----------------
src/windows/MediaFile.js | 27 ++-
tests/tests.js | 163 ++++++++++------
www/CaptureAudioOptions.js | 2 +-
www/CaptureError.js | 2 +-
www/CaptureImageOptions.js | 2 +-
www/CaptureVideoOptions.js | 2 +-
www/ConfigurationData.js | 2 +-
www/MediaFile.js | 2 +-
www/MediaFileData.js | 2 +-
www/android/init.js | 2 +-
www/capture.js | 2 +-
www/helpers.js | 2 +-
16 files changed, 524 insertions(+), 322 deletions(-)
diff --git a/.eslintrc.yml b/.eslintrc.yml
index 0cccb8c..6a02457 100644
--- a/.eslintrc.yml
+++ b/.eslintrc.yml
@@ -1,10 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
root: true
-extends: semistandard
-rules:
- indent:
- - error
- - 4
- camelcase: off
- padded-blocks: off
- operator-linebreak: off
- no-throw-literal: off
\ No newline at end of file
+extends: "@cordova/eslint-config/browser"
+
+overrides:
+ - files: [tests/**/*.js]
+ extends: "@cordova/eslint-config/node-tests"
diff --git a/package.json b/package.json
index 1071417..a973682 100644
--- a/package.json
+++ b/package.json
@@ -29,8 +29,8 @@
"cordova-windows"
],
"scripts": {
- "test": "npm run eslint",
- "eslint": "eslint www && eslint src && eslint tests"
+ "test": "npm run lint",
+ "lint": "eslint ."
},
"author": "Apache Software Foundation",
"license": "Apache-2.0",
@@ -48,12 +48,6 @@
}
},
"devDependencies": {
- "eslint": "^4.0.0",
- "eslint-config-semistandard": "^11.0.0",
- "eslint-config-standard": "^10.2.1",
- "eslint-plugin-import": "^2.3.0",
- "eslint-plugin-node": "^5.0.0",
- "eslint-plugin-promise": "^3.5.0",
- "eslint-plugin-standard": "^3.0.1"
+ "@cordova/eslint-config": "^3.0.0"
}
}
diff --git a/src/browser/CaptureProxy.js b/src/browser/CaptureProxy.js
index 6111a8a..d5c8f8b 100644
--- a/src/browser/CaptureProxy.js
+++ b/src/browser/CaptureProxy.js
@@ -17,9 +17,7 @@
* specific language governing permissions and limitations
* under the License.
*
-*/
-
-/* global require, module */
+ */
var MediaFile = require('cordova-plugin-media-capture.MediaFile');
var MediaFileData = require('cordova-plugin-media-capture.MediaFileData');
@@ -54,18 +52,18 @@ function dataURItoBlob (dataURI) {
* Capture starts, when you clicking on preview.
*/
function CameraUI () {
-
// Root element for preview
var container = document.createElement('div');
- container.style.cssText = 'left: 0px; top: 0px; width: 100%; height: 100%; position: fixed; z-index:9999;' +
- 'padding: 40px; background-color: rgba(0,0,0,0.75);' +
- 'text-align:center; visibility: hidden';
+ container.style.cssText =
+ 'left: 0px; top: 0px; width: 100%; height: 100%; position: fixed; z-index:9999;' +
+ 'padding: 40px; background-color: rgba(0,0,0,0.75);' +
+ 'text-align:center; visibility: hidden';
// Set up root element contetnts
container.innerHTML =
'<div id="captureHint" style="height:100%; position:relative; display:inline-flex; align-content:flex-start;">' +
'<h2 style="position: absolute; width: 100%; background-color: rgba(255,255,255,0.25); margin: 0">' +
- 'Click on preview to capture image. Click outside of preview to cancel.</h1>' +
+ 'Click on preview to capture image. Click outside of preview to cancel.</h1>' +
'<video id="capturePreview" style="height: 100%"></video>' +
'</div>';
@@ -114,15 +112,19 @@ CameraUI.prototype.startPreview = function (count, successCB, errorCB) {
errorCB(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
};
- navigator.getUserMedia({video: true}, function (previewStream) {
- // Save video stream to be able to stop it later
- that._previewStream = previewStream;
- that.preview.src = URL.createObjectURL(previewStream); // eslint-disable-line no-undef
- // We don't need to set visibility = true for preview element
- // since this will be done automatically in onplay event handler
- }, function (/* err */) {
- errorCB(new CaptureError(CaptureError.CAPTURE_INTERNAL_ERR));
- });
+ navigator.getUserMedia(
+ { video: true },
+ function (previewStream) {
+ // Save video stream to be able to stop it later
+ that._previewStream = previewStream;
+ that.preview.src = URL.createObjectURL(previewStream); // eslint-disable-line no-undef
+ // We don't need to set visibility = true for preview element
+ // since this will be done automatically in onplay event handler
+ },
+ function (/* err */) {
+ errorCB(new CaptureError(CaptureError.CAPTURE_INTERNAL_ERR));
+ }
+ );
};
/**
@@ -152,7 +154,6 @@ module.exports = {
},
captureImage: function (successCallback, errorCallback, args) {
-
var fail = function (code) {
if (errorCallback) {
errorCallback(new CaptureError(code || CaptureError.CAPTURE_INTERNAL_ERR));
@@ -170,10 +171,8 @@ module.exports = {
// Counter for already taken images
var imagesTaken = 0;
- navigator.getUserMedia = navigator.getUserMedia ||
- navigator.webkitGetUserMedia ||
- navigator.mozGetUserMedia ||
- navigator.msGetUserMedia;
+ navigator.getUserMedia =
+ navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
if (!navigator.getUserMedia) {
fail(CaptureError.CAPTURE_NOT_SUPPORTED);
@@ -181,45 +180,60 @@ module.exports = {
}
var ui = new CameraUI();
- ui.startPreview(limit, function (data) {
- // Check if we're done with capture. If so, then destroy UI
- if (++imagesTaken >= limit) {
+ ui.startPreview(
+ limit,
+ function (data) {
+ // Check if we're done with capture. If so, then destroy UI
+ if (++imagesTaken >= limit) {
+ ui.destroyPreview();
+ }
+
+ // Array of resultant MediaFiles
+ var mediaFiles = [];
+
+ // save data to file here
+ window.requestFileSystem(
+ window.TEMPORARY,
+ data.length * limit,
+ function (fileSystem) {
+ // If we need to capture multiple files, then append counter to filename
+ var fileName = limit <= 1 ? 'image.jpg' : 'image' + imagesTaken + '.jpg';
+ fileSystem.root.getFile(
+ fileName,
+ { create: true },
+ function (file) {
+ file.createWriter(function (writer) {
+ writer.onwriteend = function () {
+ file.getMetadata(function (meta) {
+ mediaFiles.push(
+ new MediaFile(file.name, file.toURL(), 'image/jpeg', meta.modificationTime, meta.size)
+ );
+ // Check if we're done with capture. If so, then call a successCallback
+ if (imagesTaken >= limit) {
+ successCallback(mediaFiles);
+ }
+ }, fail);
+ };
+ writer.onerror = fail;
+ // Since success callback for start preview returns
+ // a base64 encoded string, we need to convert it to blob first
+ writer.write(dataURItoBlob(data));
+ });
+ },
+ fail
+ );
+ },
+ fail
+ );
+ },
+ function (err) {
ui.destroyPreview();
+ fail(err.code);
}
-
- // Array of resultant MediaFiles
- var mediaFiles = [];
-
- // save data to file here
- window.requestFileSystem(window.TEMPORARY, data.length * limit, function (fileSystem) {
- // If we need to capture multiple files, then append counter to filename
- var fileName = limit <= 1 ? 'image.jpg' : 'image' + imagesTaken + '.jpg';
- fileSystem.root.getFile(fileName, {create: true}, function (file) {
- file.createWriter(function (writer) {
- writer.onwriteend = function () {
- file.getMetadata(function (meta) {
- mediaFiles.push(new MediaFile(file.name, file.toURL(), 'image/jpeg', meta.modificationTime, meta.size));
- // Check if we're done with capture. If so, then call a successCallback
- if (imagesTaken >= limit) {
- successCallback(mediaFiles);
- }
- }, fail);
- };
- writer.onerror = fail;
- // Since success callback for start preview returns
- // a base64 encoded string, we need to convert it to blob first
- writer.write(dataURItoBlob(data));
- });
- }, fail);
- }, fail);
- }, function (err) {
- ui.destroyPreview();
- fail(err.code);
- });
+ );
},
getFormatData: function (successCallback, errorCallback, args) {
-
var img = document.createElement('img');
img.src = args[0];
img.onload = function () {
diff --git a/src/windows/CaptureProxy.js b/src/windows/CaptureProxy.js
index a4b146c..b881d66 100644
--- a/src/windows/CaptureProxy.js
+++ b/src/windows/CaptureProxy.js
@@ -17,9 +17,9 @@
* specific language governing permissions and limitations
* under the License.
*
-*/
+ */
-/* global Windows:true */
+/* global Windows */
var MediaFile = require('cordova-plugin-media-capture.MediaFile');
var CaptureError = require('cordova-plugin-media-capture.CaptureError');
@@ -31,7 +31,6 @@ var MediaFileData = require('cordova-plugin-media-capture.MediaFileData');
* Class that combines all logic for capturing picture and video on WP8.1
*/
function MediaCaptureProxy () {
-
var previewContainer;
var capturePreview = null;
var captureCancelButton = null; // eslint-disable-line no-unused-vars
@@ -64,18 +63,26 @@ function MediaCaptureProxy () {
* Capture starts, when you clicking on preview.
*/
function createCameraUI () {
-
var buttonStyle = 'margin: 7px; border: 2.5px solid white; width: 45%; height: 35px; color: white; background-color: black;';
previewContainer = document.createElement('div');
- previewContainer.style.cssText = 'background-position: 50% 50%; background-repeat: no-repeat; background-size: contain; background-color: black; left: 0px; top: 0px; width: 100%; height: 100%; position: fixed; z-index: 9999';
+ previewContainer.style.cssText =
+ 'background-position: 50% 50%; background-repeat: no-repeat; background-size: contain; background-color: black; left: 0px; top: 0px; width: 100%; height: 100%; position: fixed; z-index: 9999';
previewContainer.innerHTML =
'<video id="capturePreview" style="width: 100%; height: 100%"></video>' +
'<div id="previewButtons" style="width: 100%; bottom: 0px; display: flex; position: absolute; justify-content: space-around; background-color: black;">' +
- '<button id="takePicture" style="' + buttonStyle + '">Capture</button>' +
- '<button id="cancelCapture" style="' + buttonStyle + '">Cancel</button>' +
- '<button id="selectPicture" style="display: none; ' + buttonStyle + '">Accept</button>' +
- '<button id="retakePicture" style="display: none; ' + buttonStyle + '">Retake</button>' +
+ '<button id="takePicture" style="' +
+ buttonStyle +
+ '">Capture</button>' +
+ '<button id="cancelCapture" style="' +
+ buttonStyle +
+ '">Cancel</button>' +
+ '<button id="selectPicture" style="display: none; ' +
+ buttonStyle +
+ '">Accept</button>' +
+ '<button id="retakePicture" style="display: none; ' +
+ buttonStyle +
+ '">Retake</button>' +
'</div>';
document.body.appendChild(previewContainer);
@@ -103,7 +110,9 @@ function MediaCaptureProxy () {
// try to select appropriate device for capture
// rear camera is preferred option
var expectedPanel = Windows.Devices.Enumeration.Panel.back;
- Windows.Devices.Enumeration.DeviceInformation.findAllAsync(Windows.Devices.Enumeration.DeviceClass.videoCapture).done(function (devices) {
+ Windows.Devices.Enumeration.DeviceInformation.findAllAsync(Windows.Devices.Enumeration.DeviceClass.videoCapture).done(function (
+ devices
+ ) {
if (devices.length > 0) {
devices.forEach(function (currDev) {
if (currDev.enclosureLocation && currDev.enclosureLocation.panel && currDev.enclosureLocation.panel === expectedPanel) {
@@ -111,30 +120,33 @@ function MediaCaptureProxy () {
}
});
- capture.initializeAsync(captureSettings).done(function () {
- // This is necessary since WP8.1 MediaCapture outputs video stream rotated 90 degrees CCW
- // TODO: This can be not consistent across devices, need additional testing on various devices
- // msdn.microsoft.com/en-us/library/windows/apps/hh452807.aspx
- capture.setPreviewRotation(Windows.Media.Capture.VideoRotation.clockwise90Degrees);
- capturePreview.msZoom = true;
-
- capturePreview.src = URL.createObjectURL(capture); // eslint-disable-line no-undef
- capturePreview.play();
-
- previewContainer.style.display = 'block';
-
- // Bind events to controls
- capturePreview.onclick = takeCallback;
- document.getElementById('takePicture').onclick = takeCallback;
- document.getElementById('cancelCapture').onclick = function () {
- errorCallback(CaptureError.CAPTURE_NO_MEDIA_FILES);
- };
- document.getElementById('selectPicture').onclick = selectCallback;
- document.getElementById('retakePicture').onclick = retakeCallback;
- }, function (err) {
- destroyCameraPreview();
- errorCallback(CaptureError.CAPTURE_INTERNAL_ERR, err);
- });
+ capture.initializeAsync(captureSettings).done(
+ function () {
+ // This is necessary since WP8.1 MediaCapture outputs video stream rotated 90 degrees CCW
+ // TODO: This can be not consistent across devices, need additional testing on various devices
+ // msdn.microsoft.com/en-us/library/windows/apps/hh452807.aspx
+ capture.setPreviewRotation(Windows.Media.Capture.VideoRotation.clockwise90Degrees);
+ capturePreview.msZoom = true;
+
+ capturePreview.src = URL.createObjectURL(capture); // eslint-disable-line no-undef
+ capturePreview.play();
+
+ previewContainer.style.display = 'block';
+
+ // Bind events to controls
+ capturePreview.onclick = takeCallback;
+ document.getElementById('takePicture').onclick = takeCallback;
+ document.getElementById('cancelCapture').onclick = function () {
+ errorCallback(CaptureError.CAPTURE_NO_MEDIA_FILES);
+ };
+ document.getElementById('selectPicture').onclick = selectCallback;
+ document.getElementById('retakePicture').onclick = retakeCallback;
+ },
+ function (err) {
+ destroyCameraPreview();
+ errorCallback(CaptureError.CAPTURE_INTERNAL_ERR, err);
+ }
+ );
} else {
// no appropriate devices found
destroyCameraPreview();
@@ -175,22 +187,30 @@ function MediaCaptureProxy () {
toggleElements('cancelCapture');
document.getElementById('takePicture').text = 'Stop';
- var encodingProperties = Windows.Media.MediaProperties.MediaEncodingProfile.createMp4(Windows.Media.MediaProperties.VideoEncodingQuality.auto);
+ var encodingProperties = Windows.Media.MediaProperties.MediaEncodingProfile.createMp4(
+ Windows.Media.MediaProperties.VideoEncodingQuality.auto
+ );
var generateUniqueCollisionOption = Windows.Storage.CreationCollisionOption.generateUniqueName;
var localFolder = Windows.Storage.ApplicationData.current.localFolder;
- localFolder.createFileAsync('cameraCaptureVideo.mp4', generateUniqueCollisionOption).done(function (capturedFile) {
- capture.startRecordToStorageFileAsync(encodingProperties, capturedFile).done(function () {
- capturedVideoFile = capturedFile;
- captureStarted = true;
- }, function (err) {
+ localFolder.createFileAsync('cameraCaptureVideo.mp4', generateUniqueCollisionOption).done(
+ function (capturedFile) {
+ capture.startRecordToStorageFileAsync(encodingProperties, capturedFile).done(
+ function () {
+ capturedVideoFile = capturedFile;
+ captureStarted = true;
+ },
+ function (err) {
+ destroyCameraPreview();
+ errorCallback(CaptureError.CAPTURE_INTERNAL_ERR, err);
+ }
+ );
+ },
+ function (err) {
destroyCameraPreview();
errorCallback(CaptureError.CAPTURE_INTERNAL_ERR, err);
- });
- }, function (err) {
- destroyCameraPreview();
- errorCallback(CaptureError.CAPTURE_INTERNAL_ERR, err);
- });
+ }
+ );
} else {
capture.stopRecordAsync().done(function () {
destroyCameraPreview();
@@ -219,21 +239,27 @@ function MediaCaptureProxy () {
var overwriteCollisionOption = Windows.Storage.CreationCollisionOption.replaceExisting;
var tempFolder = Windows.Storage.ApplicationData.current.temporaryFolder;
- tempFolder.createFileAsync('cameraCaptureImage.jpg', overwriteCollisionOption).done(function (capturedFile) {
- capture.capturePhotoToStorageFileAsync(encodingProperties, capturedFile).done(function () {
- // store intermediate result in object's global variable
- capturedPictureFile = capturedFile;
- // show pre-captured image and toggle visibility of all buttons
- previewContainer.style.backgroundImage = 'url("' + 'ms-appdata:///temp/' + capturedFile.name + '")';
- toggleElements('capturePreview', 'takePicture', 'cancelCapture', 'selectPicture', 'retakePicture');
- }, function (err) {
+ tempFolder.createFileAsync('cameraCaptureImage.jpg', overwriteCollisionOption).done(
+ function (capturedFile) {
+ capture.capturePhotoToStorageFileAsync(encodingProperties, capturedFile).done(
+ function () {
+ // store intermediate result in object's global variable
+ capturedPictureFile = capturedFile;
+ // show pre-captured image and toggle visibility of all buttons
+ previewContainer.style.backgroundImage = 'url("' + 'ms-appdata:///temp/' + capturedFile.name + '")';
+ toggleElements('capturePreview', 'takePicture', 'cancelCapture', 'selectPicture', 'retakePicture');
+ },
+ function (err) {
+ destroyCameraPreview();
+ errorCallback(CaptureError.CAPTURE_INTERNAL_ERR, err);
+ }
+ );
+ },
+ function (err) {
destroyCameraPreview();
errorCallback(CaptureError.CAPTURE_INTERNAL_ERR, err);
- });
- }, function (err) {
- destroyCameraPreview();
- errorCallback(CaptureError.CAPTURE_INTERNAL_ERR, err);
- });
+ }
+ );
},
// error + cancel callback
function (err) {
@@ -245,13 +271,16 @@ function MediaCaptureProxy () {
var generateUniqueCollisionOption = Windows.Storage.CreationCollisionOption.generateUniqueName;
var localFolder = Windows.Storage.ApplicationData.current.localFolder;
- capturedPictureFile.copyAsync(localFolder, capturedPictureFile.name, generateUniqueCollisionOption).done(function (copiedFile) {
- destroyCameraPreview();
- successCallback(copiedFile);
- }, function (err) {
- destroyCameraPreview();
- errorCallback(err);
- });
+ capturedPictureFile.copyAsync(localFolder, capturedPictureFile.name, generateUniqueCollisionOption).done(
+ function (copiedFile) {
+ destroyCameraPreview();
+ successCallback(copiedFile);
+ },
+ function (err) {
+ destroyCameraPreview();
+ errorCallback(err);
+ }
+ );
},
// Callback for retake button - just toggles visibility of necessary elements
function () {
@@ -267,12 +296,11 @@ function MediaCaptureProxy () {
}
module.exports = {
-
captureAudio: function (successCallback, errorCallback, args) {
var options = args[0];
var audioOptions = new CaptureAudioOptions();
- if (typeof (options.duration) === 'undefined') {
+ if (typeof options.duration === 'undefined') {
audioOptions.duration = 3600; // Arbitrary amount, need to change later
} else if (options.duration > 0) {
audioOptions.duration = options.duration;
@@ -298,45 +326,68 @@ module.exports = {
var stopRecordTimeout;
var stopRecord = function () {
- mediaCapture.stopRecordAsync().then(function () {
- capturedFile.getBasicPropertiesAsync().then(function (basicProperties) {
- var result = new MediaFile(capturedFile.name, 'ms-appdata:///local/' + capturedFile.name, capturedFile.contentType, basicProperties.dateModified, basicProperties.size);
- result.fullPath = capturedFile.path;
- successCallback([result]);
- }, function () {
+ mediaCapture.stopRecordAsync().then(
+ function () {
+ capturedFile.getBasicPropertiesAsync().then(
+ function (basicProperties) {
+ var result = new MediaFile(
+ capturedFile.name,
+ 'ms-appdata:///local/' + capturedFile.name,
+ capturedFile.contentType,
+ basicProperties.dateModified,
+ basicProperties.size
+ );
+ result.fullPath = capturedFile.path;
+ successCallback([result]);
+ },
+ function () {
+ errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
+ }
+ );
+ },
+ function () {
errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
- });
- }, function () { errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES)); });
+ }
+ );
};
mediaCapture.initializeAsync(mediaCaptureSettings).done(function () {
- localAppData.createFileAsync('captureAudio.mp3', generateUniqueName).then(function (storageFile) {
- capturedFile = storageFile;
- mediaCapture.startRecordToStorageFileAsync(mp3EncodingProfile, capturedFile).then(function () {
- stopRecordTimeout = setTimeout(stopRecord, audioOptions.duration * 1000);
- }, function (err) {
- // -1072868846 is the error code for "No suitable transform was found to encode or decode the content."
- // so we try to use another (m4a) format
- if (err.number === -1072868846) {
- // first we clear existing timeout to prevent success callback to be called with invalid arguments
- // second we start same actions to try to record m4a audio
- clearTimeout(stopRecordTimeout);
- localAppData.createFileAsync('captureAudio.m4a', generateUniqueName).then(function (storageFile) {
- capturedFile = storageFile;
- mediaCapture.startRecordToStorageFileAsync(m4aEncodingProfile, capturedFile).then(function () {
- stopRecordTimeout = setTimeout(stopRecord, audioOptions.duration * 1000);
- }, function () {
- // if we here, we're totally failed to record either mp3 or m4a
+ localAppData.createFileAsync('captureAudio.mp3', generateUniqueName).then(
+ function (storageFile) {
+ capturedFile = storageFile;
+ mediaCapture.startRecordToStorageFileAsync(mp3EncodingProfile, capturedFile).then(
+ function () {
+ stopRecordTimeout = setTimeout(stopRecord, audioOptions.duration * 1000);
+ },
+ function (err) {
+ // -1072868846 is the error code for "No suitable transform was found to encode or decode the content."
+ // so we try to use another (m4a) format
+ if (err.number === -1072868846) {
+ // first we clear existing timeout to prevent success callback to be called with invalid arguments
+ // second we start same actions to try to record m4a audio
+ clearTimeout(stopRecordTimeout);
+ localAppData.createFileAsync('captureAudio.m4a', generateUniqueName).then(function (storageFile) {
+ capturedFile = storageFile;
+ mediaCapture.startRecordToStorageFileAsync(m4aEncodingProfile, capturedFile).then(
+ function () {
+ stopRecordTimeout = setTimeout(stopRecord, audioOptions.duration * 1000);
+ },
+ function () {
+ // if we here, we're totally failed to record either mp3 or m4a
+ errorCallback(new CaptureError(CaptureError.CAPTURE_INTERNAL_ERR));
+ }
+ );
+ });
+ } else {
errorCallback(new CaptureError(CaptureError.CAPTURE_INTERNAL_ERR));
-
- });
- });
- } else {
- errorCallback(new CaptureError(CaptureError.CAPTURE_INTERNAL_ERR));
-
- }
- });
- }, function () { errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES)); });
+ }
+ }
+ );
+ },
+ function () {
+ errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
+ }
+ );
});
},
@@ -356,42 +407,72 @@ module.exports = {
var proxy = new MediaCaptureProxy();
- proxy.capturePhoto(function (photoFile) {
- photoFile.getBasicPropertiesAsync().done(function (basicProperties) {
- var result = new MediaFile(photoFile.name, 'ms-appdata:///local/' + photoFile.name, photoFile.contentType, basicProperties.dateModified, basicProperties.size);
- result.fullPath = photoFile.path;
- successCallback([result]);
- }, function (err) {
- fail(CaptureError.CAPTURE_INTERNAL_ERR, err);
- });
- }, function (err) {
- fail(err);
- });
-
+ proxy.capturePhoto(
+ function (photoFile) {
+ photoFile.getBasicPropertiesAsync().done(
+ function (basicProperties) {
+ var result = new MediaFile(
+ photoFile.name,
+ 'ms-appdata:///local/' + photoFile.name,
+ photoFile.contentType,
+ basicProperties.dateModified,
+ basicProperties.size
+ );
+ result.fullPath = photoFile.path;
+ successCallback([result]);
+ },
+ function (err) {
+ fail(CaptureError.CAPTURE_INTERNAL_ERR, err);
+ }
+ );
+ },
+ function (err) {
+ fail(err);
+ }
+ );
} else {
var cameraCaptureUI = new Windows.Media.Capture.CameraCaptureUI();
cameraCaptureUI.photoSettings.allowCropping = true;
cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.highestAvailable;
cameraCaptureUI.photoSettings.format = Windows.Media.Capture.CameraCaptureUIPhotoFormat.jpeg;
- cameraCaptureUI.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.photo).done(function (file) {
- if (file) {
- file.moveAsync(Windows.Storage.ApplicationData.current.localFolder, 'cameraCaptureImage.jpg', Windows.Storage.NameCollisionOption.generateUniqueName).then(function () {
- file.getBasicPropertiesAsync().then(function (basicProperties) {
- var result = new MediaFile(file.name, 'ms-appdata:///local/' + file.name, file.contentType, basicProperties.dateModified, basicProperties.size);
- result.fullPath = file.path;
- successCallback([result]);
- }, function () {
- errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
- });
- }, function () {
+ cameraCaptureUI.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.photo).done(
+ function (file) {
+ if (file) {
+ file.moveAsync(
+ Windows.Storage.ApplicationData.current.localFolder,
+ 'cameraCaptureImage.jpg',
+ Windows.Storage.NameCollisionOption.generateUniqueName
+ ).then(
+ function () {
+ file.getBasicPropertiesAsync().then(
+ function (basicProperties) {
+ var result = new MediaFile(
+ file.name,
+ 'ms-appdata:///local/' + file.name,
+ file.contentType,
+ basicProperties.dateModified,
+ basicProperties.size
+ );
+ result.fullPath = file.path;
+ successCallback([result]);
+ },
+ function () {
+ errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
+ }
+ );
+ },
+ function () {
+ errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
+ }
+ );
+ } else {
errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
- });
- } else {
+ }
+ },
+ function () {
errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
}
- }, function () {
- errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
- });
+ );
}
},
@@ -413,17 +494,24 @@ module.exports = {
var proxy = new MediaCaptureProxy();
proxy.captureVideo(function (videoFile) {
- videoFile.getBasicPropertiesAsync().done(function (basicProperties) {
- var result = new MediaFile(videoFile.name, 'ms-appdata:///local/' + videoFile.name, videoFile.contentType, basicProperties.dateModified, basicProperties.size);
- result.fullPath = videoFile.path;
- successCallback([result]);
- }, function (err) {
- fail(CaptureError.CAPTURE_INTERNAL_ERR, err);
- });
+ videoFile.getBasicPropertiesAsync().done(
+ function (basicProperties) {
+ var result = new MediaFile(
+ videoFile.name,
+ 'ms-appdata:///local/' + videoFile.name,
+ videoFile.contentType,
+ basicProperties.dateModified,
+ basicProperties.size
+ );
+ result.fullPath = videoFile.path;
+ successCallback([result]);
+ },
+ function (err) {
+ fail(CaptureError.CAPTURE_INTERNAL_ERR, err);
+ }
+ );
}, fail);
-
} else {
-
var videoOptions = new CaptureVideoOptions();
if (options.duration && options.duration > 0) {
videoOptions.duration = options.duration;
@@ -435,23 +523,44 @@ module.exports = {
cameraCaptureUI.videoSettings.allowTrimming = true;
cameraCaptureUI.videoSettings.format = Windows.Media.Capture.CameraCaptureUIVideoFormat.mp4;
cameraCaptureUI.videoSettings.maxDurationInSeconds = videoOptions.duration;
- cameraCaptureUI.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.video).then(function (file) {
- if (file) {
- file.moveAsync(Windows.Storage.ApplicationData.current.localFolder, 'cameraCaptureVideo.mp4', Windows.Storage.NameCollisionOption.generateUniqueName).then(function () {
- file.getBasicPropertiesAsync().then(function (basicProperties) {
- var result = new MediaFile(file.name, 'ms-appdata:///local/' + file.name, file.contentType, basicProperties.dateModified, basicProperties.size);
- result.fullPath = file.path;
- successCallback([result]);
- }, function () {
- errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
- });
- }, function () {
+ cameraCaptureUI.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.video).then(
+ function (file) {
+ if (file) {
+ file.moveAsync(
+ Windows.Storage.ApplicationData.current.localFolder,
+ 'cameraCaptureVideo.mp4',
+ Windows.Storage.NameCollisionOption.generateUniqueName
+ ).then(
+ function () {
+ file.getBasicPropertiesAsync().then(
+ function (basicProperties) {
+ var result = new MediaFile(
+ file.name,
+ 'ms-appdata:///local/' + file.name,
+ file.contentType,
+ basicProperties.dateModified,
+ basicProperties.size
+ );
+ result.fullPath = file.path;
+ successCallback([result]);
+ },
+ function () {
+ errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
+ }
+ );
+ },
+ function () {
+ errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
+ }
+ );
+ } else {
errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
- });
- } else {
+ }
+ },
+ function () {
errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
}
- }, function () { errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES)); });
+ );
}
},
@@ -460,25 +569,45 @@ module.exports = {
function (storageFile) {
var mediaTypeFlag = String(storageFile.contentType).split('/')[0].toLowerCase();
if (mediaTypeFlag === 'audio') {
- storageFile.properties.getMusicPropertiesAsync().then(function (audioProperties) {
- successCallback(new MediaFileData(null, audioProperties.bitrate, 0, 0, audioProperties.duration / 1000));
- }, function () {
- errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
- });
+ storageFile.properties.getMusicPropertiesAsync().then(
+ function (audioProperties) {
+ successCallback(new MediaFileData(null, audioProperties.bitrate, 0, 0, audioProperties.duration / 1000));
+ },
+ function () {
+ errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
+ }
+ );
} else if (mediaTypeFlag === 'video') {
- storageFile.properties.getVideoPropertiesAsync().then(function (videoProperties) {
- successCallback(new MediaFileData(null, videoProperties.bitrate, videoProperties.height, videoProperties.width, videoProperties.duration / 1000));
- }, function () {
- errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
- });
+ storageFile.properties.getVideoPropertiesAsync().then(
+ function (videoProperties) {
+ successCallback(
+ new MediaFileData(
+ null,
+ videoProperties.bitrate,
+ videoProperties.height,
+ videoProperties.width,
+ videoProperties.duration / 1000
+ )
+ );
+ },
+ function () {
+ errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
+ }
+ );
} else if (mediaTypeFlag === 'image') {
- storageFile.properties.getImagePropertiesAsync().then(function (imageProperties) {
- successCallback(new MediaFileData(null, 0, imageProperties.height, imageProperties.width, 0));
- }, function () {
- errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
- });
- } else { errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT)); }
- }, function () {
+ storageFile.properties.getImagePropertiesAsync().then(
+ function (imageProperties) {
+ successCallback(new MediaFileData(null, 0, imageProperties.height, imageProperties.width, 0));
+ },
+ function () {
+ errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
+ }
+ );
+ } else {
+ errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
+ }
+ },
+ function () {
errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
}
);
diff --git a/src/windows/MediaFile.js b/src/windows/MediaFile.js
index 0579ee0..e57d14c 100644
--- a/src/windows/MediaFile.js
+++ b/src/windows/MediaFile.js
@@ -17,15 +17,14 @@
* specific language governing permissions and limitations
* under the License.
*
-*/
+ */
-/* global Windows:true */
+/* global Windows */
var MediaFileData = require('cordova-plugin-media-capture.MediaFileData');
var CaptureError = require('cordova-plugin-media-capture.CaptureError');
module.exports = {
-
getFormatData: function (successCallback, errorCallback, args) {
Windows.Storage.StorageFile.getFileFromPathAsync(this.fullPath).then(
function (storageFile) {
@@ -34,15 +33,25 @@ module.exports = {
storageFile.properties.getMusicPropertiesAsync().then(
function (audioProperties) {
successCallback(new MediaFileData(null, audioProperties.bitrate, 0, 0, audioProperties.duration / 1000));
- }, function () {
+ },
+ function () {
errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
}
);
} else if (mediaTypeFlag === 'video') {
storageFile.properties.getVideoPropertiesAsync().then(
function (videoProperties) {
- successCallback(new MediaFileData(null, videoProperties.bitrate, videoProperties.height, videoProperties.width, videoProperties.duration / 1000));
- }, function () {
+ successCallback(
+ new MediaFileData(
+ null,
+ videoProperties.bitrate,
+ videoProperties.height,
+ videoProperties.width,
+ videoProperties.duration / 1000
+ )
+ );
+ },
+ function () {
errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
}
);
@@ -50,14 +59,16 @@ module.exports = {
storageFile.properties.getImagePropertiesAsync().then(
function (imageProperties) {
successCallback(new MediaFileData(null, 0, imageProperties.height, imageProperties.width, 0));
- }, function () {
+ },
+ function () {
errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
}
);
} else {
errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
}
- }, function () {
+ },
+ function () {
errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
}
);
diff --git a/tests/tests.js b/tests/tests.js
index a810f3e..ed87df7 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -17,11 +17,10 @@
* specific language governing permissions and limitations
* under the License.
*
-*/
+ */
-/* eslint-env jasmine */
/* global CaptureAudioOptions, CaptureImageOptions, CaptureVideoOptions, CaptureError */
-/* global Media, MediaFile, MediaFileData, resolveLocalFileSystemURL */
+/* global Media, MediaFile, MediaFileData, resolveLocalFileSystemURL, cordova */
exports.defineAutoTests = function () {
describe('Capture (navigator.device.capture)', function () {
@@ -150,7 +149,8 @@ exports.defineManualTests = function (contentEl, createActionButton) {
function captureImageWin (mediaFiles) {
var path = mediaFiles[0].fullPath;
// Necessary since windows doesn't allow file URLs for <img> elements
- if (cordova.platformId === 'windows' || cordova.platformId === 'windows8' || cordova.platformId === 'browser') { // eslint-disable-line no-undef
+ if (cordova.platformId === 'windows' || cordova.platformId === 'windows8' || cordova.platformId === 'browser') {
+ // eslint-disable-line no-undef
path = mediaFiles[0].localURL;
}
log('Image captured: ' + path);
@@ -160,17 +160,20 @@ exports.defineManualTests = function (contentEl, createActionButton) {
function captureImagesWin (mediaFiles) {
var path = mediaFiles[0].fullPath;
// Necessary since windows doesn't allow file URLs for <img> elements
- if (cordova.platformId === 'windows' || cordova.platformId === 'windows8' || cordova.platformId === 'browser') { // eslint-disable-line no-undef
+ if (cordova.platformId === 'windows' || cordova.platformId === 'windows8' || cordova.platformId === 'browser') {
+ // eslint-disable-line no-undef
path = mediaFiles[0].localURL;
}
var path2 = mediaFiles[1].fullPath;
// Necessary since windows doesn't allow file URLs for <img> elements
- if (cordova.platformId === 'windows' || cordova.platformId === 'windows8' || cordova.platformId === 'browser') { // eslint-disable-line no-undef
+ if (cordova.platformId === 'windows' || cordova.platformId === 'windows8' || cordova.platformId === 'browser') {
+ // eslint-disable-line no-undef
path = mediaFiles[1].localURL;
}
var path3 = mediaFiles[2].fullPath;
// Necessary since windows doesn't allow file URLs for <img> elements
- if (cordova.platformId === 'windows' || cordova.platformId === 'windows8' || cordova.platformId === 'browser') { // eslint-disable-line no-undef
+ if (cordova.platformId === 'windows' || cordova.platformId === 'windows8' || cordova.platformId === 'browser') {
+ // eslint-disable-line no-undef
path = mediaFiles[2].localURL;
}
log('Image captured: ' + path);
@@ -222,10 +225,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
}
function getMetadataWin (metadata) {
- var strMetadata =
- 'duration = ' + metadata.duration + '\n' +
- 'width = ' + metadata.width + '\n' +
- 'height = ' + metadata.height;
+ var strMetadata = 'duration = ' + metadata.duration + '\n' + 'width = ' + metadata.width + '\n' + 'height = ' + metadata.height;
log(strMetadata);
}
@@ -266,36 +266,48 @@ exports.defineManualTests = function (contentEl, createActionButton) {
}
function resolveMediaFileURL (mediaFile, callback) {
- resolveLocalFileSystemURL(mediaFile.localURL, function (entry) {
- log('Resolved by URL: ' + mediaFile.localURL);
- if (callback) callback();
- }, function (err) {
- log('Failed to resolve by URL: ' + mediaFile.localURL);
- log('Error: ' + JSON.stringify(err));
- if (callback) callback();
- });
+ resolveLocalFileSystemURL(
+ mediaFile.localURL,
+ function (entry) {
+ log('Resolved by URL: ' + mediaFile.localURL);
+ if (callback) callback();
+ },
+ function (err) {
+ log('Failed to resolve by URL: ' + mediaFile.localURL);
+ log('Error: ' + JSON.stringify(err));
+ if (callback) callback();
+ }
+ );
}
function resolveMediaFile (mediaFile, callback) {
- resolveLocalFileSystemURL(mediaFile.fullPath, function (entry) {
- log('Resolved by path: ' + mediaFile.fullPath);
- if (callback) callback();
- }, function (err) {
- log('Failed to resolve by path: ' + mediaFile.fullPath);
- log('Error: ' + JSON.stringify(err));
- if (callback) callback();
- });
+ resolveLocalFileSystemURL(
+ mediaFile.fullPath,
+ function (entry) {
+ log('Resolved by path: ' + mediaFile.fullPath);
+ if (callback) callback();
+ },
+ function (err) {
+ log('Failed to resolve by path: ' + mediaFile.fullPath);
+ log('Error: ' + JSON.stringify(err));
+ if (callback) callback();
+ }
+ );
}
function resolveVideo () {
clearStatus();
var options = { limit: 1, duration: 5 };
- navigator.device.capture.captureVideo(function (mediaFiles) {
- captureVideoWin(mediaFiles);
- resolveMediaFile(mediaFiles[0], function () {
- resolveMediaFileURL(mediaFiles[0]);
- });
- }, captureVideoFail, options);
+ navigator.device.capture.captureVideo(
+ function (mediaFiles) {
+ captureVideoWin(mediaFiles);
+ resolveMediaFile(mediaFiles[0], function () {
+ resolveMediaFileURL(mediaFiles[0]);
+ });
+ },
+ captureVideoFail,
+ options
+ );
}
function clearStatus () {
@@ -307,7 +319,8 @@ exports.defineManualTests = function (contentEl, createActionButton) {
/******************************************************************************/
- contentEl.innerHTML = '<div id="info" style="white-space: pre-wrap">' +
+ contentEl.innerHTML =
+ '<div id="info" style="white-space: pre-wrap">' +
'<b>Status:</b> <div id="camera_status"></div>' +
'img1: <img width="100" id="camera_image">' +
'img2: <img width="100" id="camera_image2">' +
@@ -328,31 +341,59 @@ exports.defineManualTests = function (contentEl, createActionButton) {
'<p/> <div id="prohibited_camera_image"></div>' +
'Expected result (iOS only): camera picker and alert with message that camera access is prohibited are shown. The alert has 2 buttons: OK and Settings. By click on "OK" camera is hidden, by pressing Settings it shows privacy settings for the app';
- createActionButton('Capture 10 sec of audio and play', function () {
- getAudio();
- }, 'audio');
-
- createActionButton('Capture 1 image', function () {
- getImage();
- }, 'image');
-
- createActionButton('Capture 3 images', function () {
- getImages();
- }, 'images');
-
- createActionButton('Capture 10 sec of video', function () {
- getVideo();
- }, 'video');
-
- createActionButton('Capture 5 sec of video and resolve', function () {
- resolveVideo();
- }, 'video_and_resolve');
-
- createActionButton('Disable access to Camera and click to capture video', function () {
- getVideoPermissionError();
- }, 'prohibited_camera_video');
-
- createActionButton('Disable access to Camera and click to capture image', function () {
- getImagePermissionError();
- }, 'prohibited_camera_image');
+ createActionButton(
+ 'Capture 10 sec of audio and play',
+ function () {
+ getAudio();
+ },
+ 'audio'
+ );
+
+ createActionButton(
+ 'Capture 1 image',
+ function () {
+ getImage();
+ },
+ 'image'
+ );
+
+ createActionButton(
+ 'Capture 3 images',
+ function () {
+ getImages();
+ },
+ 'images'
+ );
+
+ createActionButton(
+ 'Capture 10 sec of video',
+ function () {
+ getVideo();
+ },
+ 'video'
+ );
+
+ createActionButton(
+ 'Capture 5 sec of video and resolve',
+ function () {
+ resolveVideo();
+ },
+ 'video_and_resolve'
+ );
+
+ createActionButton(
+ 'Disable access to Camera and click to capture video',
+ function () {
+ getVideoPermissionError();
+ },
+ 'prohibited_camera_video'
+ );
+
+ createActionButton(
+ 'Disable access to Camera and click to capture image',
+ function () {
+ getImagePermissionError();
+ },
+ 'prohibited_camera_image'
+ );
};
diff --git a/www/CaptureAudioOptions.js b/www/CaptureAudioOptions.js
index 4df58c2..65aad35 100644
--- a/www/CaptureAudioOptions.js
+++ b/www/CaptureAudioOptions.js
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
*
-*/
+ */
/**
* Encapsulates all audio capture operation configuration options.
diff --git a/www/CaptureError.js b/www/CaptureError.js
index 1771726..63c1997 100644
--- a/www/CaptureError.js
+++ b/www/CaptureError.js
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
*
-*/
+ */
/**
* The CaptureError interface encapsulates all errors in the Capture API.
diff --git a/www/CaptureImageOptions.js b/www/CaptureImageOptions.js
index 20fc69b..869661f 100644
--- a/www/CaptureImageOptions.js
+++ b/www/CaptureImageOptions.js
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
*
-*/
+ */
/**
* Encapsulates all image capture operation configuration options.
diff --git a/www/CaptureVideoOptions.js b/www/CaptureVideoOptions.js
index 3c36b0b..6487174 100644
--- a/www/CaptureVideoOptions.js
+++ b/www/CaptureVideoOptions.js
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
*
-*/
+ */
/**
* Encapsulates all video capture operation configuration options.
diff --git a/www/ConfigurationData.js b/www/ConfigurationData.js
index 0012e6f..abaf4b3 100644
--- a/www/ConfigurationData.js
+++ b/www/ConfigurationData.js
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
*
-*/
+ */
/**
* Encapsulates a set of parameters that the capture device supports.
diff --git a/www/MediaFile.js b/www/MediaFile.js
index 371b5d2..311386e 100644
--- a/www/MediaFile.js
+++ b/www/MediaFile.js
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
*
-*/
+ */
var utils = require('cordova/utils');
var exec = require('cordova/exec');
diff --git a/www/MediaFileData.js b/www/MediaFileData.js
index e5a10cb..2031f6a 100644
--- a/www/MediaFileData.js
+++ b/www/MediaFileData.js
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
*
-*/
+ */
/**
* MediaFileData encapsulates format information of a media file.
diff --git a/www/android/init.js b/www/android/init.js
index d153e3a..928d008 100644
--- a/www/android/init.js
+++ b/www/android/init.js
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
*
-*/
+ */
var cordova = require('cordova');
var helpers = require('./helpers');
diff --git a/www/capture.js b/www/capture.js
index dfe7d29..26b08ed 100644
--- a/www/capture.js
+++ b/www/capture.js
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
*
-*/
+ */
var exec = require('cordova/exec');
var helpers = require('./helpers');
diff --git a/www/helpers.js b/www/helpers.js
index 082db56..b1a99fc 100644
--- a/www/helpers.js
+++ b/www/helpers.js
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
*
-*/
+ */
var MediaFile = require('./MediaFile');
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org