How to use the cordova-plugin-media-capture.CaptureError.CAPTURE_INVALID_ARGUMENT function in cordova-plugin-media-capture

To help you get started, we’ve selected a few cordova-plugin-media-capture examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apache / cordova-plugin-media-capture / src / browser / CaptureProxy.js View on Github external
captureImage: function (successCallback, errorCallback, args) {

        var fail = function (code) {
            if (errorCallback) {
                errorCallback(new CaptureError(code || CaptureError.CAPTURE_INTERNAL_ERR));
            }
        };

        var options = args[0];

        var limit = options.limit || 1;
        if (typeof limit !== 'number' || limit < 1) {
            fail(CaptureError.CAPTURE_INVALID_ARGUMENT);
            return;
        }

        // Counter for already taken images
        var imagesTaken = 0;

        navigator.getUserMedia = navigator.getUserMedia ||
                         navigator.webkitGetUserMedia ||
                         navigator.mozGetUserMedia ||
                         navigator.msGetUserMedia;

        if (!navigator.getUserMedia) {
            fail(CaptureError.CAPTURE_NOT_SUPPORTED);
            return;
        }
github apache / cordova-plugin-media-capture / src / windows / MediaFile.js View on Github external
}, function () {
                            errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
                        }
                    );
github apache / cordova-plugin-media-capture / src / windows / CaptureProxy.js View on Github external
}, function () {
                        errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
                    });
                } else if (mediaTypeFlag === 'image') {