cutCtrl.js 800 B

12345678910111213141516171819202122232425262728293031323334353637
  1. app.controller('cutCtrl', function ($scope, $http,video,notify) {
  2. $scope.inicio=0;
  3. $scope.fin=0;
  4. $scope.curso="";
  5. $scope.desc="";
  6. $scope.video = video;
  7. $scope.post = function() {
  8. var data = {
  9. curso: $scope.curso,
  10. desc: $scope.desc,
  11. inicio: $scope.inicio,
  12. fin: $scope.fin,
  13. id: $scope.video._id
  14. };
  15. $http.post('/back/crop/', data)
  16. .success(function(data,state) {
  17. notify({message:data.status,classes:"alert"});
  18. })
  19. .error(function(data) {
  20. notify({message:data.status,classes:"alert alert-danger"});
  21. });
  22. };
  23. function getVideoTime(){
  24. var video = document.getElementById("video");
  25. return video.currentTime;
  26. }
  27. $scope.setEnd = function() {
  28. $scope.fin=getVideoTime();
  29. };
  30. $scope.setStart = function() {
  31. $scope.inicio=getVideoTime();
  32. };
  33. });