Browse Source

fix: 播放时间超过30s会错误显示

newraina 8 years ago
parent
commit
491dc22c19
4 changed files with 5 additions and 3 deletions
  1. 2 1
      dist/meplayer.js
  2. 0 0
      dist/meplayer.min.js
  3. 1 1
      package.json
  4. 2 1
      src/js/main.js

+ 2 - 1
dist/meplayer.js

@@ -152,7 +152,8 @@
 	    }
 
 	    function handleTimeUpdate() {
-	        var curTime = audio.currentTime.toFixed(0);
+	        console.log(currentTime);
+	        var curTime = audio.currentTime | 0;
 	        var curTimeForLrc = audio.currentTime.toFixed(3);
 	        var playPercent = 100 * (curTime / duration);
 

File diff suppressed because it is too large
+ 0 - 0
dist/meplayer.min.js


+ 1 - 1
package.json

@@ -4,7 +4,7 @@
   "description": "a simple and reliable HTML5 music player",
   "main": "dist/meplayer.min.js",
   "scripts": {
-    "test": "gulp"
+    "build": "gulp"
   },
   "repository": {
     "type": "git",

+ 2 - 1
src/js/main.js

@@ -97,7 +97,8 @@ root.mePlayer = function (options) {
     }
 
     function handleTimeUpdate() {
-        var curTime       = (audio.currentTime).toFixed(0);
+        console.log(currentTime)
+        var curTime       = audio.currentTime | 0;
         var curTimeForLrc = (audio.currentTime).toFixed(3);
         var playPercent   = 100 * (curTime / duration);
 

Some files were not shown because too many files changed in this diff