How to use the cordova-plugin-media-capture.CaptureError.CAPTURE_INTERNAL_ERR 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 / windows / CaptureProxy.js View on Github external
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));

                    }
                });
            }, function () { errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES)); });
github apache / cordova-plugin-media-capture / src / browser / CaptureProxy.js View on Github external
var fail = function (code) {
            if (errorCallback) {
                errorCallback(new CaptureError(code || CaptureError.CAPTURE_INTERNAL_ERR));
            }
        };
github apache / cordova-plugin-media-capture / src / windows / CaptureProxy.js View on Github external
}, function (err) {
                    fail(CaptureError.CAPTURE_INTERNAL_ERR, err);
                });
            }, fail);
github apache / cordova-plugin-media-capture / src / windows / CaptureProxy.js View on Github external
}, function (err) {
                                destroyCameraPreview();
                                errorCallback(CaptureError.CAPTURE_INTERNAL_ERR, err);
                            });
                        }, function (err) {