-2
자바 스크립트 코드 작성 방법을 모르겠으므로 음악 재생 및 정지 라디오 플레이어 토글 버튼을 만드는 데 어려움을 겪고 있습니다. 개발자가 서버에 Icecast를 설치했지만 불행히도 그는 매우 바쁩니다. 내가 가지고있는 것은 페이지가로드 될 때 자동으로 음악을 재생하는 HTML입니다.라디오 플레이어의 토글 시작/중지 버튼 만들기
많은 감사합니다.
<!DOCTYPE html>
<html lang="en">
<head>
<script src="http://radiocambodia.live/sound_manager/script/soundmanager2-jsmin.js"></script>
<script src="http://radiocambodia.live/Helpers.js"></script>
<script src="http://radiocambodia.live/WebRadio.js"></script>
<script>
var stream_url = "http://radiocambodia.live:8000/stream.ogg";
var radio = new WebRadio(stream_url);
radio.init({
onloaded: function() {
console.log("Playing !");
radio.soundObject.play();
},
onplaying: function() {
}
});
</script>
</head>
<body>
<a href="#"><img src="http://radiocambodia.live/pause.png" width="45" height="45" id="stopbutton" onclick='toggleSound()'; /></a>
<script type="text/javascript">
function toggleSound() {
if (radio.soundObject.play){
document.getElementById('soundObject.stop').src='stop.png';
}else{
document.getElementById('soundObject.play').src='play.png';
}
</script>
</body>
</html>
많은 분들께 감사드립니다. azs06, 매우 쉽게 보이지만 코딩이 너무 어려워졌습니다! – snowblood
사파리에서 작동하지 않는 이유를 알고 계십니까? ( – snowblood
사파리에서 작동하지 않는 이유가 확실하지 않으므로 stream (http://radiocambodia.live:8000/stream.ogg)이로드되지 않는 것 같습니다. 사파리. – azs06