From 9c2ada67dfbe14b29ff5fe42d9a089f6bd972260 Mon Sep 17 00:00:00 2001 From: listen1 Date: Mon, 23 May 2016 16:12:53 +0800 Subject: [PATCH] fix bug: volume settings not work for initial and new songs --- js/app.js | 3 +++ js/vendor/angular-soundmanager2.js | 2 ++ 2 files changed, 5 insertions(+) diff --git a/js/app.js b/js/app.js index d9dd17d..58c91ef 100644 --- a/js/app.js +++ b/js/app.js @@ -482,6 +482,9 @@ $scope.volume = 90; $scope.saveLocalSettings(); } + else { + angularPlayer.adjustVolumeSlider($scope.volume); + } } $scope.saveLocalSettings = function() { diff --git a/js/vendor/angular-soundmanager2.js b/js/vendor/angular-soundmanager2.js index 3fad623..08eac4a 100644 --- a/js/vendor/angular-soundmanager2.js +++ b/js/vendor/angular-soundmanager2.js @@ -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) {