@@ -117,11 +117,13 @@ app.controller('PlayerCtrl', function ($scope, $rootScope, playerService, queueS
117117 var playPause = new gui . Shortcut ( {
118118 key : 'MediaPlayPause' ,
119119 active : function ( ) {
120- if ( $rootScope . isSongPlaying ) {
121- playerService . pauseSong ( ) ;
122- } else {
123- playerService . playSong ( ) ;
124- }
120+ $scope . $apply ( function ( ) {
121+ if ( $rootScope . isSongPlaying ) {
122+ playerService . pauseSong ( ) ;
123+ } else {
124+ playerService . playSong ( ) ;
125+ }
126+ } ) ;
125127 } ,
126128 failed : function ( ) {
127129 // nothing here
@@ -131,9 +133,11 @@ app.controller('PlayerCtrl', function ($scope, $rootScope, playerService, queueS
131133 var stop = new gui . Shortcut ( {
132134 key : 'MediaStop' ,
133135 active : function ( ) {
134- if ( $rootScope . isSongPlaying ) {
135- playerService . pauseSong ( ) ;
136- }
136+ $scope . $apply ( function ( ) {
137+ if ( $rootScope . isSongPlaying ) {
138+ playerService . pauseSong ( ) ;
139+ }
140+ } ) ;
137141 } ,
138142 failed : function ( ) {
139143 // nothing here
@@ -143,9 +147,11 @@ app.controller('PlayerCtrl', function ($scope, $rootScope, playerService, queueS
143147 var prevTrack = new gui . Shortcut ( {
144148 key : 'MediaPrevTrack' ,
145149 active : function ( ) {
146- if ( $rootScope . isSongPlaying ) {
147- playerService . playPrevSong ( ) ;
148- }
150+ $scope . $apply ( function ( ) {
151+ if ( $rootScope . isSongPlaying ) {
152+ playerService . playPrevSong ( ) ;
153+ }
154+ } ) ;
149155 } ,
150156 failed : function ( ) {
151157 // nothing here
@@ -155,9 +161,11 @@ app.controller('PlayerCtrl', function ($scope, $rootScope, playerService, queueS
155161 var nextTrack = new gui . Shortcut ( {
156162 key : 'MediaNextTrack' ,
157163 active : function ( ) {
158- if ( $rootScope . isSongPlaying ) {
159- playerService . playNextSong ( ) ;
160- }
164+ $scope . $apply ( function ( ) {
165+ if ( $rootScope . isSongPlaying ) {
166+ playerService . playNextSong ( ) ;
167+ }
168+ } ) ;
161169 } ,
162170 failed : function ( ) {
163171 // nothing here
0 commit comments