浏览代码

song progress bar updated

unknown 9 年之前
父节点
当前提交
8373d28595
共有 2 个文件被更改,包括 5 次插入7 次删除
  1. 1 0
      app/app.css
  2. 4 7
      app/app.js

+ 1 - 0
app/app.css

@@ -351,6 +351,7 @@ footer a:hover{
   width: 0;
   width: 0;
   height: 5px;
   height: 5px;
   margin-left: 35px;
   margin-left: 35px;
+  background-color: rgba(102,205,170,1);
 }
 }
 @media (max-width: 992px) {
 @media (max-width: 992px) {
     .station {
     .station {

+ 4 - 7
app/app.js

@@ -103,9 +103,6 @@ if (Meteor.isClient) {
         },
         },
         artist: function(){
         artist: function(){
           return Session.get("artist");
           return Session.get("artist");
-        },
-        duration: function(){
-
         }
         }
     });
     });
 
 
@@ -127,12 +124,14 @@ if (Meteor.isClient) {
                 SC.stream("/tracks/" + currentSong.song.id + "/", function(sound){
                 SC.stream("/tracks/" + currentSong.song.id + "/", function(sound){
                     _sound = sound;
                     _sound = sound;
                     sound._player._volume = 0.3;
                     sound._player._volume = 0.3;
+                    console.log(sound);
                     sound.play();
                     sound.play();
                     Session.set("title", currentSong.song.title || "Title");
                     Session.set("title", currentSong.song.title || "Title");
                     Session.set("artist", currentSong.song.artist || "Artist");
                     Session.set("artist", currentSong.song.artist || "Artist");
                     Session.set("albumArt", currentSong.song.albumArt);
                     Session.set("albumArt", currentSong.song.albumArt);
                     Session.set("duration", currentSong.song.duration);
                     Session.set("duration", currentSong.song.duration);
-                    Session.set("increment", 1400 / currentSong.song.duration);
+                    $("#seeker-bar").css("transition", Session.get("duration") + "s")
+                    $("#seeker-bar").width(1400);
                     setTimeout(function() { // HACK, otherwise seek doesn't work.
                     setTimeout(function() { // HACK, otherwise seek doesn't work.
                         sound._player.seek(getTimeElapsed());
                         sound._player.seek(getTimeElapsed());
                     }, 500);
                     }, 500);
@@ -154,15 +153,13 @@ if (Meteor.isClient) {
                 size = data.history.length;
                 size = data.history.length;
                 startSong();
                 startSong();
             }
             }
-            $("#seeker-bar").width($("#seeker-bar").width() + Session.get("increment"));
-            console.log($("#seeker-bar").width());
         }, 1000);
         }, 1000);
     });
     });
 }
 }
 
 
 if (Meteor.isServer) {
 if (Meteor.isServer) {
     var startedAt = Date.now();
     var startedAt = Date.now();
-    var songs = [{id: 172055891, title: "Immortals", artist: "Fall Out Boy", duration: 90}];
+    var songs = [{id: 216112412, title: "How Deep Is Your Love", artist: "Calvin Harris", duration: 193}];
     var currentSong = 0;
     var currentSong = 0;
     addToHistory(songs[currentSong], startedAt);
     addToHistory(songs[currentSong], startedAt);