2013-05-07 2 views
0

ipad 전용 페이지를 만들고 있습니다.HTML5 오디오의 다중 인스턴스 - 언제든지 하나만 재생하면됩니다.

페이지에 12 개의 오디오 플레이어가 있습니다. 한 번에 하나의 오디오 플레이어 만 재생하면됩니다. 아래 코드는 플레이어를 한 번 시작하고 중지 한 후에 만 ​​작동합니다. 처음으로 노래를 연주 할 때 모두가 동시에 연주 할 수 있습니다. 어떤 아이디어?

<script> 
var currentPlayer; 
function EvalSound(soundobj) { 

    var thissound=document.getElementById(soundobj); 
    if(currentPlayer && currentPlayer != thissound) { 
     currentPlayer.pause(); 
    } 
    if (thissound.paused) 
     thissound.play(); 
else 
    thissound.pause(); 
    thissound.currentTime = 0; 
    currentPlayer = thissound; 
} 
</script> 

HTML

<a href="card3_ipad.php?card=country" onClick="EvalSound('song1'); return true;" 
target="iframe"><img src="images/countrytab.gif" border=0 width=128 height=29> 
</a> 

<a href="card3_ipad.php?card=blues" onClick="EvalSound('song2'); return true;" 
target="iframe"><img src="images/bluestab.gif" border=0 width=128 height=29> 
</a> 

건배

톰은 IOS (아이폰, 아이 패드)에 대한 수 없습니다

답변

0

Read apple guideline

, 당신은 위의 링크를 확인하실 수 있습니다

,

복수의 동시 오디오 또는 비디오 스트림

현재 iOS를 실행하는 모든 장치는 언제든지 단일 오디오 또는 비디오 스트림 재생으로 제한됩니다. iOS 기기에서는 두 개 이상의 동영상을 나란히 재생하거나 부분적으로 겹치거나 완전히 겹쳐서 재생할 수 없습니다. 동시에 여러 오디오 스트림을 재생하는 것도 지원되지 않습니다. 그러나 오디오 또는 비디오 소스를 동적으로 변경할 수 있습니다. 자세한 내용은 "미디어 소스를 순차적으로 교체"를 참조하십시오.

관련 문제