Skip to content

Commit

Permalink
issue #19
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusgimenez committed Jul 14, 2015
1 parent d812dfd commit c3960f3
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
7 changes: 6 additions & 1 deletion assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6234,14 +6234,19 @@ font-size: 0.7em;
height: 100%;
}
.sc-player .sc-controls{
background-image:url(../images/player.png);
background-image:url('../images/player.png');
height: 90px;
width: 90px;
content:'';
}
.sc-player.playing .sc-controls {
background-image:url('../images/player.png');
background-position: 90px;
}
.sc-player.loadbg .sc-controls {
background:url('../images/preloader-bg.gif') center center no-repeat;
background-size: cover;
}
.midia-category{
margin: 0 0 30px 10%;
}
Expand Down
3 changes: 3 additions & 0 deletions assets/js/libs/soundcloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
},
// fired when widget starts playing current track (fired only once per track)
onMediaStart : function(flashId, data) {
alert('start');
this._redispatch('onMediaStart', flashId, data);
},
// fired when the track/playlist has finished playing
Expand All @@ -113,6 +114,7 @@
},
// fired when widget starts playing current track (fired on every play, seek)
onMediaPlay : function(flashId, data) {
alert('play')
this._redispatch('onMediaPlay', flashId, data);
},
// fired when track was paused
Expand Down Expand Up @@ -582,6 +584,7 @@
})
// when the loaded track started to play
.bind('scPlayer:onMediaPlay', function(event) {
alert('ahoy');
clearInterval(positionPoll);
positionPoll = setInterval(function() {
var duration = audioEngine.getDuration(),
Expand Down
17 changes: 17 additions & 0 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -650,4 +650,21 @@ twitterFetcher.fetch(config1);
$(document).on('closed.fndtn.reveal', '[data-reveal]', function () {
$.scPlayer.stopAll();
});
$(document).on('onPlayerPlay.scPlayer', function(e){
$(e.target).addClass('loadbg');
var check_timer = function() {
var timer = $(e.target).find('.sc-scrubber .sc-time-span .sc-buffer').css('width');
var timer = timer.split('.');
console.log(timer[0]);
if(parseInt(timer[0]) >= 1){
$(e.target).removeClass('loadbg');
}
else{
setTimeout(function(){
check_timer();
},1)
}
}
check_timer();
});
});

0 comments on commit c3960f3

Please sign in to comment.