function yyy_html5_audio($url) {
if (preg_match('/Firefox/', $_SERVER["HTTP_USER_AGENT"])) {
// For religious reasons Firefox does not support MP3 format in HTML5 audio tag, use Flash player instead
$embed = '';
} else if (preg_match('/Opera/', $_SERVER["HTTP_USER_AGENT"])) {
// Opera also does not support MP3 format in HTML5 audio tag, use Flash player instead
$embed = '';
} else if (preg_match('/MSIE/', $_SERVER["HTTP_USER_AGENT"])) {
$embed = '[Internet Explorer does not support OGG format]';
} else if (preg_match('/MSIE/', $_SERVER["HTTP_USER_AGENT"])) {
$embed = '[Internet Explorer does not support WAV format]';
} else {
$embed = '';
}
return $embed;
}
将上面代码黏贴在 function.php 里面。
模板里应用:
echo yyy_html5_audio('mediaurl');
效果如下
Comments
1,149 responses to “Media, Audio, Video Player for wordpress”