다음 코드가 있는데 무엇이 잘못되었는지 잘 모릅니다. 오디오 파일이있는 원격 호스트에 문제가 있습니까? Chrome에서 가끔은 재생되며 때때로 재생되지 않으며 재생되지 않을 때 브라우저가 오디오 형식을 지원하지 않는다고하지 않습니다.왜 오디오가 때때로 같은 브라우저에서 재생되지 않는가?
<audio controls id="audio" style="display:none">
<source src="http://langcomplab.net/Honey_Gatherers_Master.mp3" type="audio/mpeg" />
Your browser doesn't support this audio format.
</audio>
<button id="button">Play</button>
<script type="text/javascript">
// run on page load
var button = document.getElementById('button');
var audio = document.getElementById('audio');
var onClick = function() {
audio.play(); // audio will load and then play
};
button.addEventListener('click', onClick, false);
</script>
업데이트 : 정말 이상해. 소스 섹션에서 나는
</html> tag for a block in Qualtrics but when I source my code using rich context editor the tags fade away. Any solution to this?
<html>
<body onload='Qualtrics.SurveyEngine.addOnload'>
<p>The next two stories will be the two stories presented auditorily. Please press the “Play Story” button now to hear an example auditory story. Be sure to adjust the volume of the device on which you are listening so that you can hear the auditory story clearly.</p>
<p> </p>
<div>
<audio controls="" id="audio1" style="display:none"><source src="http://langcomplab.net/Test_take2.mp3" style="width:50%" type="audio/mpeg" />Your browser doesn't support this audio format.</audio>
</div>
<div><button name="play" onclick="disabled=true" style="height:25px; width:200px" type="button">Play Story</button>
<p> </p>
</div>
</body>
</html>
P.S를 추가 : 내가 onload
섹션에서 적절한 기능을 사용하고 있습니까?
나는 그것을 상쾌하게하고 있지만 크롬에 문제가있는 것 같지 않다. – vico
나는 무엇이 문제의 원인인지 정말로 모른다. 1 시간 전에 나에게 일하지 않고 지금 일하고있다. 문제를 다시 발생시키는 법을 모르겠습니다. –
내 iPad에서 버튼이 작동하지 않습니다 (오디오 파일이 매우 느리게로드되어 0시에 멈춤) Ps :'display : none'이 iOS에서 작동하지 않습니다 –