I am using some keyboard shortcuts for Next/Back navigation (arrows ← →), and another for Play/Pause audio (\ key). However, the first is not working with IE, and the second not working in both Firefox nor Internet Explorer. I am not sure what is the global function to work in all browsers, or what part in the script to edit for that.
js 1 (not working with Internet Explorer):
jQuery(function( $ ) {
var keymap = {};
keymap[ 37 ] = "#prev";
keymap[ 39 ] = "#next";
$( document ).on( "keyup", function(event) {
var href,
selector = keymap[ event.which ];
if ( selector ) {
href = $( selector ).attr( "href" );
if ( href ) {
window.location = href;
}
}
});
});
js 2 (not working with Firefox nor IE):
$(document).keypress(function(e) {
var video = document.getElementById("myAudio");
// \
if ((event.which == 92) || (event.keyCode==92)) {
if (video.paused)
video.play();
else
video.pause();
}
});