0
我正嘗試在node.js堆棧頂部使用Paper.js創建一個簡單的調諧器。在iPhone中導致閃爍的HTML音頻播放
調諧器的工作原理以及在桌面瀏覽器,但是當在iPhone或iPad,點擊六個長方形的一個(或字符串),導致屏幕的奇閃爍: http://morning-temple-9106.herokuapp.com/
我想這些CSS修復了與iphone上的一般html閃爍有關的問題,但沒有運氣。
canvas {
-webkit-backface-visibility: hidden;
-webkit-transform: translate3d(0,0,0);
}
這裏是加載音頻JS - 我加載文件playNote被稱爲快速播放之前。即使我在playNote中加載,也會出現閃爍。
var audioPlayerE = new Audio();
audioPlayerE.src="strings/E.mp3"
audioPlayerE.load();
var audioPlayerA = new Audio();
audioPlayerA.src="strings/A.mp3"
audioPlayerA.load();
var audioPlayerD = new Audio();
audioPlayerD.src="strings/D.mp3";
audioPlayerD.load();
var audioPlayerG = new Audio();
audioPlayerG.src="strings/G.mp3";
audioPlayerG.load();
var audioPlayerB = new Audio();
audioPlayerB.src="strings/B.mp3";
audioPlayerB.load();
var audioPlayerElittle = new Audio();
audioPlayerElittle.src="strings/Elittle.mp3";
audioPlayerElittle.load();
playNote = function(index,count) {
var noteStr;
if(index-count==0) {audioPlayerE.play()}
if(index-count==1) {audioPlayerA.play()}
if(index-count==2) {audioPlayerD.play()}
if(index-count==3) {audioPlayerG.play()}
if(index-count==4) {audioPlayerB.play()}
if(index-count==5) {audioPlayerElittle.play()}
}
這裏是我的github回購: https://github.com/dannycochran/cs184
很奇怪。看起來它是一個webkit突出事件。將其添加到畫布css中修復它: -webkit-tap-highlight-color:rgba(0,0,0,0); – dcochran 2013-03-21 22:48:30