Fix spacebar pause keybinding
This commit is contained in:
parent
e60e00f8f9
commit
0f67a2312a
3 changed files with 21 additions and 1 deletions
|
@ -208,7 +208,7 @@ angular.module('JamStash')
|
|||
} else if (unicode == 37 || unicode == 177) { // back arrow
|
||||
player.previousTrack();
|
||||
} else if (unicode == 32 || unicode == 179 || unicode.toString() == '0179') { // spacebar
|
||||
player.playPauseSong();
|
||||
player.pause();
|
||||
return false;
|
||||
} else if (unicode == 36 && $('#tabLibrary').is(':visible')) { // home
|
||||
$('#left-component').stop().scrollTo('#MusicFolders', 400);
|
||||
|
|
|
@ -149,6 +149,18 @@ angular.module('jamstash.player.directive', ['jamstash.player.service', 'jamstas
|
|||
}
|
||||
});
|
||||
|
||||
scope.$watch(function () {
|
||||
return playerService.pauseSong;
|
||||
}, function (newVal) {
|
||||
if(newVal === true) {
|
||||
$player.jPlayer('pause');
|
||||
playerService.pauseSong = true;
|
||||
} else {
|
||||
$player.jPlayer('play');
|
||||
playerService.pauseSong = false;
|
||||
}
|
||||
});
|
||||
|
||||
scope.$watch(function () {
|
||||
return globals.settings.SaveTrackPosition;
|
||||
}, function (newVal) {
|
||||
|
|
|
@ -29,6 +29,14 @@ angular.module('jamstash.player.service', ['jamstash.settings', 'angular-undersc
|
|||
}
|
||||
},
|
||||
|
||||
pause: function(song) {
|
||||
if (player.pauseSong) {
|
||||
player.pauseSong = false;
|
||||
} else {
|
||||
player.pauseSong = true;
|
||||
}
|
||||
},
|
||||
|
||||
playFirstSong: function() {
|
||||
player._playingIndex = 0;
|
||||
player.play(player.queue[0]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue