How to use the cordova-plugin-media-capture.CaptureError.CAPTURE_NOT_SUPPORTED 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
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;
        }

        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.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
github apache / cordova-plugin-media-capture / src / browser / CaptureProxy.js View on Github external
captureVideo: function (successCallback, errorCallback) {
        if (errorCallback) {
            errorCallback(new CaptureError(CaptureError.CAPTURE_NOT_SUPPORTED));
        }
    },