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

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

formula - R: how to pass in a reference to the variable in glm or lm? -