返回列表 发帖

〖分享〗Discuz!自定义代码之 『全能播放器』

可自动播放的格式:wma,mp3,wmv,asf,mpg,mpeg,avi,asx,rm,rmvb,ra,ram,swf

步骤:
一,进入后台-》『Discuz! 代码』中,新添加一个标签  mv,输入图标文件地址,提交!
二,进入『详情』
替换内容:

  1. <script language="javascript">
  2. var LINK = new Array("{1}");
  3. var linkType = new Array();
  4. linkType['WMA'] = 'WMP';
  5. linkType['MP3'] = 'WMP';
  6. linkType['WMV'] = 'WMP';
  7. linkType['ASF'] = 'WMP';
  8. linkType['MPG'] = 'WMP';
  9. linkType['MPEG'] = 'WMP';
  10. linkType['AVI'] = 'WMP';
  11. linkType['ASX'] = 'WMP';
  12. linkType['RM'] = 'Real';
  13. linkType['RMVB'] = 'Real';
  14. linkType['RAM'] = 'Real';
  15. linkType['RA'] = 'Real';
  16. linkType['SWF'] = 'Flash';
  17. var sufFix = LINK[0].substring(LINK[0].lastIndexOf(".")+1,LINK[0].length).toUpperCase();
  18. if(sufFix.indexOf("#")) sufFix = sufFix.split("#")[0];
  19. if(sufFix.indexOf("?")) sufFix = sufFix.split("?")[0];
  20. function WMP(){
  21. document.writeln("<object id='mediaplayer' width='480' height="+((sufFix=="MP3"||sufFix=="WMA")?"64":"424")+" classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' align='center' border='0' type='application/x-oleobject' standby='Loading Windows Media Player components...'>");
  22. document.writeln("<param name='url' value='"+LINK[0]+"'>");
  23. document.writeln("<param name='AutoStart' value='1'><param name='Balance' value='0'><param name='enabled' value='-1'><param name='EnableContextMenu' value='0'><param name='PlayCount' value='1'><param name='rate' value='1'><param name='currentPosition' value='0'><param name='currentMarker' value='0'><param name='defaultFrame' value=''><param name='invokeURLs' value='-1'><param name='baseURL' value=''><param name='stretchToFit' value='0'><param name='volume' value='100'><param name='mute' value='0'><param name='uiMode' value='full'><param name='windowlessVideo' value='0'><param name='fullScreen' value='0'><param name='enableErrorDialogs' value='0'><param name='SAMIStyle' value=''><param name='SAMILang' value=''><param name='SAMIFilename' value=''><param name='captioningID' value=''>");
  24. document.writeln("</object>");
  25. document.close();
  26. }
  27. function Real(){
  28. document.writeln("<object classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' width='400' height='300'  id='amourReal'>");
  29. document.writeln("  <param name='src' value='"+LINK[0]+"'>");
  30. document.writeln("  <param name='autostart' value='true'>");
  31. document.writeln("  <param name='controls' value='imagewindow'>");
  32. document.writeln("  <param name='console' value='clip1'>");
  33. document.writeln("  <embed src='"+LINK[0]+"' width='400' height='300' type='audio/x-pn-realaudio-plugin' autostart='true' controls='imagewindow' console='video'>");
  34. document.writeln("  </embed>");
  35. document.writeln("</object>");
  36. document.writeln("<br />");
  37. document.writeln("<object classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' width='400' height='50' id='amourReal'>");
  38. document.writeln("  <param name='src' value='"+LINK[0]+"'>");
  39. document.writeln("  <param name='autostart' value='true'>");
  40. document.writeln("  <param name='controls' value='all'>");
  41. document.writeln("  <param name='console' value='clip1'>");
  42. document.writeln("  <embed type='audio/x-pn-realaudio-plugin' src='"+LINK[0]+"' width='400' height='50' autostart='true' controls='all' console='video'>");
  43. document.writeln("  </embed>");
  44. document.writeln("</object>");
  45. document.close();
  46. }
  47. function Flash(){
  48. document.write("<object classid='clsid27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='600' height='480'>");
  49. document.write("<param name='movie' value='"+LINK[0]+"'>");
  50. document.write("<param name='quality' value='high'>");
  51. document.write("<embed src='"+LINK[0]+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='480' height='330'></embed>");
  52. document.write("</object>");
  53. document.close();
  54. }
  55. function Default(){
  56. document.writeln("<a href='"+ LINK[0] +"' target='_blank'>" + LINK[1] + "</a>");
  57. document.close();
  58. }
  59. if(linkType[sufFix]){
  60. eval(linkType[sufFix]+"()");
  61. }else{
  62. Default();
  63. }
  64. </script>
复制代码

例子:
[mv][/mv]
解释: 全能播放器

参数个数:
1   
嵌套次数
1
1

评分人数

  • liji

⌒╮ ╭⌒╮⌒╮.╭⌒╮⌒ QQ:33235219
  ╱◥██◣  欢迎光临 ╭⌒ 免费吧╭⌒
 │田︱田 田|        
 ╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬
本文转载自:【≡免费吧≡http://0937.org.ru欢迎加入我们】

经过测试发现,不能播放全部FLASH,只能播放一部分FLASH,具体什么原因还不清楚!
⌒╮ ╭⌒╮⌒╮.╭⌒╮⌒ QQ:33235219
  ╱◥██◣  欢迎光临 ╭⌒ 免费吧╭⌒
 │田︱田 田|        
 ╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬
本文转载自:【≡免费吧≡http://0937.org.ru欢迎加入我们】

TOP

这个全能播放器在7.0这个版本不能播放FLASH了,不过其他的还可以放..

TOP

谢谢老大....

TOP

不错~ 准备转载~ 嘿嘿!
站内短信:  联系斑竹
⌒╮ ╭⌒╮⌒╮.╭⌒╮⌒ QQ:51160173
  ╱◥██◣  欢迎光临 ╭⌒ 免费吧╭⌒
 │田︱田 田|     husa@vip.qq.com   
 ╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬

TOP

返回列表