Using Javascript to play HTML5 video -
how play html5 video in webpage press of single key (eg. pressing 'r' key) instead of using mouse? can somehow use javascript this?
yes, can done. following code should work.
<script type="text/javascript"> function mykeypress(e){ var keynum; if(window.event) { // ie keynum = e.keycode; } else if(e.which){ // netscape/firefox/opera keynum = e.which; } if(keynum == 82){ // 82 key code r. var samplevideo = document.getelementbyid('samplevideo'); samplevideo.play(); } } </script>
Comments
Post a Comment