How to upload video that I record using my mobile. I manage to upload the video path to Firebase but when I want to use it in my view (html file), it does not work. Here is my code:
.controller("HomeCtrl", function($scope, $firebaseArray, $cordovaCamera, $location, $cordovaCapture){
var fb = new Firebase("https://myURL.firebaseio.com/videos");
$scope.videos;
$scope.record = function(){
fb = new Firebase("https://myURL.firebaseio.com/videos");
$scope.videos = $firebaseArray(fb);
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();
pathtogostring = pathtogo.substr(6);
alert("Path of the video is = " + path.toString());
obj = {
videoP: path,
videosrc: pathtogostring
}
$scope.videos.$add(obj);
}
},
function(err) {
}
);
}//end record
})//end controller
My html file
<div ng-repeat="video in videos" class="card">
<div class="item item-text-wrap">
{{video.videoP}}
</div>
<div class="item item-text-wrap">
{{video.videosrc}}
</div>
<video controls>
<source src="video.videosrc" type="video/mp4">
</video>
</div>