mediaFiles arrya is empty

Hello there,

I have a next code for capturing video and i am trying go get video URI to display video in my app after capturing BUT, after recording of video complete, argument that should be passed to complete capture function is empty. I am displaying content "$scope.videoData’ in input field and this is does not feel changes.

Sorry if this question have obvious solution, i am beginner in ionic :slight_smile:

function ($scope, $stateParams, $cordovaMediaCapture) {

    $ = $cordovaMediaCapture.supportedVideoModes;
    $scope.videoData = 'some data';

    $scope.recordVideo = function(){
            $scope.videoData = mediaFiles;
            var i, path, len;
            for (i = 0, len = mediaFiles.length; i < len; i += 1) {
                path = typeof mediaFiles[i].localURL;
                // do something interesting with the file
                $scope.videoData = path;
            $scope.videoData = error;
        }, {limit: 3, duration: 120});