fix bug: volume settings not work for initial and new songs

This commit is contained in:
listen1 2016-05-23 16:12:53 +08:00
parent b9b530b488
commit 9c2ada67df
2 changed files with 5 additions and 0 deletions

View File

@ -482,6 +482,9 @@
$scope.volume = 90;
$scope.saveLocalSettings();
}
else {
angularPlayer.adjustVolumeSlider($scope.volume);
}
}
$scope.saveLocalSettings = function() {

View File

@ -4686,6 +4686,7 @@ ngSoundManager.factory('angularPlayer', ['$rootScope', '$log',
if ((bootstrapTrack != null) && (isResume !== true)) {
var angularPlayerObj = this;
var sound = soundManager.getSoundById(trackId);
sound.setVolume(volume);
bootstrapTrack(sound, this.currentTrackData(), function(){
soundManager.play(trackId);
$rootScope.$broadcast('track:id', trackId);
@ -4879,6 +4880,7 @@ ngSoundManager.factory('angularPlayer', ['$rootScope', '$log',
}
$rootScope.$broadcast('music:volume', volume);
};
volume = value;
changeVolume(value);
},
clearPlaylist: function(callback) {