Ben 7 лет назад
Родитель
Сommit
9559a67325

BIN
.vs/miaomiao/v14/.suo


BIN
miaomiao/bin/Android/Debug/android-debug.apk


+ 3 - 3
miaomiao/www/js/controllers/account.js

xqd
@@ -1,13 +1,13 @@
 (function (app) {
-    app.controller('wechatLoginCtrl', ["$scope","userService","$ionicNavBarDelegate", "storage", "$state", "msg", "$http", "util","common",
-    function ($scope,userService,$ionicNavBarDelegate, storage, $state, msg, $http, util,common) {
+    app.controller('wechatLoginCtrl', ["$scope","userService","$ionicNavBarDelegate", "storage", "$state", "msg", "$http", "util","common","config",
+    function ($scope, userService, $ionicNavBarDelegate, storage, $state, msg, $http, util, common, config) {
             //$ionicNavBarDelegate.showBackButton(false);
             $scope.addvideo = function () {
                 common.chooseVideo().then(function (file) {
                     msg.loading();
                     common.uploadFiles(file, 2).then(function (result) {
                         msg.hide();
-                        console.log(result);
+                        console.log(result.respons);
                         var response = JSON.parse(result.response);
                         $scope.video.server = response.data.file;
                         var file = config.imgServer + response.data.file;

+ 10 - 4
miaomiao/www/js/services/commonservice.js

xqd xqd
@@ -140,7 +140,13 @@
                         }
                         VideoEditor.transcodeVideo(
                                   function (res) {
-                                    msg.loading();
+                                      msg.loading();
+                                      ft.onprogress = function (progressEvent) {
+                                          if (progressEvent.lengthComputable) {
+                                              var per = (progressEvent.loaded / progressEvent.total) * 100;
+                                              msg.text('上传:' + Math.floor(per) + '%');
+                                          }
+                                      };
                                       ft.upload(res, encodeURI(config.server + "api/attachment/upload"), function (sucess) {
                                         msg.hide();
                                           deferred.resolve(sucess);
@@ -164,13 +170,13 @@
                                       width: 1280,
                                       height: 720,
                                       fps: 30,
-                                      videoBitrate: 3000000, // 1 megabit
+                                      videoBitrate: 2000000, // 1 megabit
                                       audioChannels: 2,
                                       audioSampleRate: 44100,
                                       audioBitrate: 128000, // 128 kilobits
                                       progress: function (info) {
-                                          var f=parseFloat(info).toFixed(2)*100;
-                                          msg.text(parseInt(f)+'%');
+                                          var f=parseFloat(info)*100;
+                                          msg.text('压缩:'+Math.floor(f) + '%');
                                       }
                                   }
                               );