html5 audio 如何判斷音頻處於暫停還是播放的狀態?
audio有沒有什麼屬性可以判斷音頻是在播放狀態還是暫停狀態
方法如下
var audioStatus = "paused";
var audio = document.getElemnentById("myAudio");
audio.addEventListener("playing", function(){
audioStatus = "playing";
});
audio.addEventListener("pause", function(){
audioStatus = "paused";
});