JW Player 空格控制播放暂停

来源:互联网 发布:校园网络拓扑结构图 编辑:程序博客网 时间:2024/05/16 18:03
  1. 转载自:http://blog.csdn.net/keyunq/article/details/7268367
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  3. <html xmlns="http://www.w3.org/1999/xhtml">  
  4. <head>  
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
  6. <title>jw</title>  
  7. <script type="text/javascript" src="/jw/jwplayer.js"></script>  
  8.   
  9. </head>  
  10.   
  11. <body onKeyDown="KeyOn_Space(event);">  
  12.   
  13. <p id="container1">Please install the Flash Plugin</p>  
  14. <script type="text/javascript">  
  15. jwplayer('container1').setup({  
  16.     'skin': "/jw/glow.zip",  
  17.     'flashplayer': '/jw/player.swf',  
  18.     'file': '/jw/3.mp4',  
  19.     'controlbar': 'bottom',  
  20.     'width': '470',  
  21.     'height': '320',  
  22.     'allowfullscreen':'true'  
  23. });  
  24.    
  25. function KeyOn_Space(ev){  
  26.     ev = ev || window.event;    
  27.     var code = (ev.keyCode || ev.which);   
  28.     if(code == 32) {  
  29.         jwplayer('container1').pause();  
  30.     }  
  31. }  
  32.   
  33. </script>  
  34. </body>  
  35. </html>  


另附jwplayer去水印版本

点此下载

0 0
原创粉丝点击