[問題] audio在ios播放時發生suspend

看板Web_Design作者 (Rain老爺)時間11年前 (2014/11/20 21:00), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
各位先進好 小弟這幾天在使用audio tag播放音檔時 發生了一些問題 我在iOS播放音訊檔時(ogg,wav,aac) 會先走loadstart 然後就直接suspend了 完全沒辦法播放 (但Android可以播放) 請問有沒有小弟沒注意到的細節呢? 請各位幫忙解答一下 謝謝 附上程式碼 var src = 'http://www.w3schools.com/html/horse.ogg', audioItem = new Audio(src); audioItem.loop = false; audioItem.autoplay = false; audioItem.preload = 'auto'; audioItem.addEventListener('loadstart', function() { alert('loadstart'); }); audioItem.addEventListener('canplay', function() { audioItem.play(); }); audioItem.addEventListener('suspend', function() { alert('suspend'); }); -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 103.3.194.108 ※ 文章網址: http://www.ptt.cc/bbs/Web_Design/M.1416488402.A.9C2.html
文章代碼(AID): #1KRUNId2 (Web_Design)