@ghamtre wrote:
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>
Posts: 3
Participants: 2