代码如下!兼容IE
// JavaScript Document function autoPlay(){//自动播放 var myAuto = document.getElementById(‘myaudio‘); myAuto.src = ‘/media/v2/sss.mp3‘;//MP3路径 myAuto.play(); } function pausePlay(){//暂停播放 var myAuto = document.getElementById(‘myaudio‘); myAuto.pause(); } function createAuto(){ var _id = $("#audio"); if (window.applicationCache) { _id.html(‘<audio id="myaudio" src="" controls="controls" loop="false" hidden="true"></audio>‘) } else { _id.html(‘<embed src="" id="myaudio" style="display: none;"></embed>‘); } }创建方式createAuto();
时间: 2024-10-05 05:05:39