I can't upload videos to Firebase

Hi guys,

I have a problem with my code and I don’t know how to fix it,
the problem is I can’t store a video capture in firebase.

Here my code:

video controller

‘use strict’;

app.controller(‘VideoCtrl’, function($scope, $cordovaCapture, $state) {

$scope.record = function() {
var options = { limit: 1, duration: 15 };
$cordovaCapture.captureVideo(options).then(function(videoData) {
          var i, path, len;
          var pathtogo;
          var pathtogostring;
        for (i = 0, len = videoData.length; i < len; i += 1) {
          path = videoData[i].fullPath;
          pathtogo = path.toString();
          obj = {
                videosrc: pathtogo 
          }
          $scope.video.$add(obj);
        }
      },
      $state.go('tab.photo-detail'),
      function(err) {
      }
     )}

});

Firebase array

‘use strict’;

app.factory(‘Products’, function(FURL, $firebaseArray, Auth) {
var ref = new Firebase(FURL);
var products = $firebaseArray(ref.child(‘products’));

var Products = {

all: function(){
  return products;
},
saveProduct: function(product, video){
  console.log('the user profile is, ', Auth.user.profile);
  var newProduct = {
    seller_image: Auth.user.profile.gravatar,
    seller_name: Auth.user.profile.name,
    name: product.name,
    tagline: product.tagline,
    description: product.description,
    price: product.price,
    video: video
  };
  return products.$add(newProduct).then(function(){
    console.log('añadido a base de datos');
  })
}

};
return Products;

});

My html

<div class="col col-33">
        <div class="item-video">
         <video width="100%" height="140" controls> <source ng-src="{{video.videosrc}}" type="video/mp4">
         </video>
        </div>
      </div>

you have to upload the video… you can not simple pass the video path as a parameter. how should ne API know, that you send a video???

you need the cordova-file-transfer plugin to upload real files.
And firebase should have some special endpoint for that upload.

and html5-video tag has no ngSrc-attribtue (this works only for images).

I installed videogular to playback the videos, but I still can’t upload them to firebase :worried:

This how my code looks now:

‘use strict’;

app.controller(‘VideoCtrl’, function(FURL, $scope, $cordovaCapture, $firebaseArray, $state) {

var rt = new Firebase(FURL);
$scope.videos = $firebaseArray(rt);
$scope.record = function(){
var options = { limit: 1, duration: 15 };
$cordovaCapture.captureVideo(options).then(
function(videoData) {
var i, path, len;
var pathtogo;
var pathtogostring;
for (i = 0, len = videoData.length; i < len; i += 1) {
path = videoData[i].fullPath;
pathtogo = path.toString();

          obj = {
                videosrc: pathtogo 
          }
          $scope.videos.$add(obj);
        }
  },
  $state.go('tab.photo-detail'),
  function(err) {
  }

);
}
});

How can I use ‘cordoba-file-transfer plugin’ for firebase?