我的网站上有5个音轨,我播放了onload()函数,在localhost上它们彼此完美同步,但在现场它们不同步, 这是我的HTML代码
<body onload="play_sounds();">
<audio id="inst" src="newReindeer/inst.mp3" loop preload="auto" type="audio/mp3"></audio>
<audio id="ten" src="newReindeer/tenor.mp3" loop preload="auto" type="audio/mp3"></audio>
<audio id="child" src="newReindeer/child.mp3" loop preload="auto" type="audio/mp3"></audio>
<audio id="lispy" src="newReindeer/lispy.mp3" loop preload="auto" type="audio/mp3"></audio>
<audio id="soprano" src="newReindeer/soprano.mp3" loop preload="auto" type="audio/mp3"></audio>
<div id="pointer_div" onclick="point_it(event)" style = "background-image:url('Visuals/desktop-2160x1920.png');width:2160px;height:1920px;">
</div>
</body>
这是我的js代码
var audio1 = document.getElementById('inst');
var audio2 = document.getElementById('ten');
var audio3 = document.getElementById('child');
var audio4 = document.getElementById('lispy');
var audio5 = document.getElementById('soprano');
function play_sounds(){
audio1.play();
audio2.play();
audio3.play();
audio3.muted=true;
audio4.play();
audio4.muted=true;
audio5.play();
audio5.muted=true;
}
这在当地工作正常,请告诉我为什么我的曲目在现场不同步?