可以试试HTML5的播放器,此方法转自他处,测试前请将文件备份好!
这里给出需要修改的代码,找到文件 \source\function\function_discuzcode.php ,搜索代码
将“case 'mp3':”下面的代码
- $randomid = 'mp3_'.random(3);
- return '<span id="'.$randomid.'"></span><script type="text/javascript" reload="1">$(\''.$randomid.'\').innerHTML=AC_FL_RunContent(\'FlashVars\', \'soundFile='.urlencode($url).'\', \'width\', \'290\', \'height\', \'24\', \'allowNetworking\', \'internal\', \'allowScriptAccess\', \'never\', \'src\', \''.STATICURL.'image/common/player.swf\', \'quality\', \'high\', \'bgcolor\', \'#FFFFFF\', \'menu\', \'false\', \'wmode\', \'transparent\', \'allowscriptaccess\', \'none\', \'allowNetworking\', \'internal\');</script>';
复制代码
替换为以下的代码
- if (strpos($_SERVER["HTTP_USER_AGENT"], "MSIE 6") || strpos($_SERVER["HTTP_USER_AGENT"], "MSIE 7") || strpos($_SERVER["HTTP_USER_AGENT"], "MSIE 8")) {//判别IE版本
- $randomid = 'mp3_'.random(3);
- return '<span id="'.$randomid.'"></span><script type="text/javascript" reload="1">$(\''.$randomid.'\').innerHTML=AC_FL_RunContent(\'FlashVars\', \'soundFile='.urlencode($url).'\', \'width\', \'290\', \'height\', \'24\', \'allowNetworking\', \'internal\', \'allowScriptAccess\', \'never\', \'src\', \''.STATICURL.'image/common/player.swf\', \'quality\', \'high\', \'bgcolor\', \'#FFFFFF\', \'menu\', \'false\', \'wmode\', \'transparent\', \'allowscriptaccess\', \'none\', \'allowNetworking\', \'internal\');</script>';
- }else {
- return '<audio src="'.$url.'" controls="true" preload="true" autoplay="true"></audio>';
- }
复制代码
|