/ Published in: JavaScript

If you happen to have a GoogleTV and you want to control using the D-Pad, here's how you do it using a switch case and jQuery.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/*************************************** D-pad ***************************************/ var video = $("video"); $(window).bind("keydown", onKeyDownHandler ); function onKeyDownHandler( e ){ switch( e.keyCode ){ case 227: //fast forward 10 seconds video.currentTime += 10; break; case 228: //rewind by 10 seconds video.currentTime -= 10; break; case 179: if( video.paused ) video.play(); else video.pause(); break; } }
Comments
