Added spacebar pause

This commit is contained in:
Kasper Rynning-Tønnesen
2017-05-27 20:18:10 +02:00
parent 94c6ac091f
commit f17ac8728b
2 changed files with 11 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1562,6 +1562,16 @@ $(document).keydown(function(event) {
found_array = []; found_array = [];
found_array_index = 0; found_array_index = 0;
} }
} else if(event.keyCode == 32 && $(".search-container").hasClass("hide") && window.location.pathname != "/") {
if(Player.player.getPlayerState() == 1) {
event.preventDefault();
Player.player.pauseVideo();
return false;
} else if(Player.player.getPlayerState() == 2) {
event.preventDefault();
Player.player.playVideo();
return false;
}
} else { } else {
find_start = false; find_start = false;
} }