HTML5 오디오 객체를 음소거하는 음소거 버튼이 있습니다. 그것은 트랙을 음소거하지만 페이드 인/아웃 효과를 추가하고 싶습니다. audio.animate({volume: 0}, 2000);
을 추가했지만 작동하지 않습니다.HTML5 음소거 버튼에 페이드 효과를 적용하는 방법
아이디어가 있으십니까?
감사합니다.
audio = new Audio();
audio.src = "http://myst729.qiniudn.com/within-temptation_pale.mp3"
audio.play();
$(".mute").on("click tap", function(){
\t if (audio.muted) {
audio.animate({volume: 1}, 2000);
audio.muted = false;
$(this).text("mute");
} else {
audio.muted = true;
audio.animate({volume: 0}, 2000);
$(this).text("unmute");
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button class="mute">mute</button>
이'audio.animate 같은 애니메이션 기능에 –
@KarthikeyanSekar을 모든 것을 넣어 (: 2000 {1 권 = 거짓 audio.muted}) ;'? – DannyBoy
[HTML5