<!DOCTYPE html>
<html>
<head>
<title>mp3</title>
<meta charset="UTF-8">
<meta name="keywords" content="mp3">
<meta name="description" content="mp3">
<meta name="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js" ></script>
<script type="text/javascript" src="js/browser.js" ></script>
<script type="text/javascript" >
function playNotify(){
if($.browser.msie && $.browser.version=='8.0')
{
$('#newMessageDIV').html('<embed src="notify.mp3"/>');
}else
{
//IE9+,Firefox,Chrome均支持<audio/>
if($.browser.mozilla)
{
var strAudio = "<audio id='audioPlay' src='notify.mp3' hidden='true'>";
$('#newMessageDIV').html(strAudio);
var audio = document.getElementById("audioPlay");
audio.play();
}else
{
$('#newMessageDIV').html('<audio autoplay="autoplay"><source src="notify.ogg" type="audio/ogg" /><source src="notify.wav"'
+ 'type="audio/wav" /><source src="notify.mp3" type="audio/mpeg" /></audio>');
}
}
}
</script>
</head>
<body>
<div id="newMessageDIV" style="display:none">notify</div>
<input style="font-size: 28px;" type="button" value="play notify mp3" onclick="playNotify()"/>
</body>
</html>
html5(h5)播放mp3全浏览器兼容
需积分: 34 84 浏览量
2018-12-20
15:38:35
上传
评论 1
收藏 107KB ZIP 举报
legend
- 粉丝: 0
- 资源: 12
最新资源
- 三菱PLC例程源码Medocsequencegenerator
- 三菱PLC例程源码M1320磨头进出FX1s控制步进电机,有注释
- STRASSEN矩阵乘法算法(改进分治法·C语言)
- 前端.xmind前端.xmind前端.xmind前端.xmind前端.xmind
- 三菱PLC例程源码LOW-E玻璃镀膜线程序(三菱QPLC的)一万步带注释
- 三菱PLC例程源码LCD设备蚀刻机程序
- 三菱PLC例程源码LCD设备蚀刻机
- 全面前端开发指南:从基础到深入
- pvk2pfx 32位 Pvk2Pfx (Pvk2Pfx.exe) 是一种命令行工具,可将 .spc、.cer 和 .pvk 文
- 三菱PLC例程源码JH21-150程序
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈