Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use additional cordova plugin (capture) #4

Open
trahloff opened this issue Apr 15, 2016 · 0 comments
Open

Can't use additional cordova plugin (capture) #4

trahloff opened this issue Apr 15, 2016 · 0 comments

Comments

@trahloff
Copy link

I installed the ngCapture Plugin and tried to use it but It seems like the controller can't acces it.
My controller:

"use strict";

angular.module("ConnectedCarApp").controller("testCtrl",function($rootScope,$cordovaCapture, $cordovaMedia, $state, $scope, $mdSidenav, $mdComponentRegistry, $http, $timeout) {

        $scope.captureAudio = function() {
          console.log("invoked captureAudio()");
            var options = {
                limit: 3,
                duration: 10
            };

            document.addEventListener("deviceready", function() {
              console.log("capturing audio...");
                $cordovaCapture.captureAudio(options).then(function(audioData) {
                    console.log(audioData);
                }, function(err) {
                    console.log(err);
                });

            }, false);
        };

    }
);

When I run captureAudio() it only logs "invoked captureAudio()" to the console but won't even log an error.
If I try to run it without the deviceready-wrapper I get an "Cannot read property 'capture' of undefined".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant