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

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -