2010-12-04 2 views
0

기본적으로이 플레이어를 시작하고 트랙을 클릭하면 중지되도록하려고합니다. 나는 이것에 비참하게 실패했다. 누구든지 이걸 전에 사용 해왔고 나에게 약간의 도움을 줄 수 있니? 나는 내가 SoundManger와 다른 문제에 대한 해결책을 찾는다이었고,이 질문에 발견이 http://www.schillmania.com/projects/soundmanager2/demo/page-player/basic.htmlJavascript SoundManager2 문제

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> 

<head> 

<title>DEMO</title> 
<link rel="stylesheet" type="text/css" href="style.css" /> 



<script type="text/javascript" src="soundmanager2.js"></script> 
<script type="text/javascript" src="page-player.js"></script> 


<script type="text/javascript"> 
soundManager.url = ''; 
soundManager.flashVersion = 9; // optional: shiny features (default = 8) 
soundManager.useFlashBlock = false; // optionally, enable when you're ready to dive in 
// enable HTML5 audio support, if you're feeling adventurous. iPad/iPhone will always get this. 
// soundManager.useHTML5Audio = true; 
</script> 





</head> 



<body> 

<h1>SM2 DEMO</h1> 



<div id="sm2-container"> 

    <!-- SM2 flash movie goes here --> 

</div> 



<ul class="playlist"> 



    <li><a href="music/bigcirclelittlecircle.mp3">TESTING</a></li> 



    <li><a href="music/bigcirclelittlecircle.mp3" title="Dr. John Groove">TESTING 2</a></li> 

    <!-- files from the web (note that ID3 and waveformData information will *not* load from remote domains without permission, due to Flash security restrictions) --> 





</ul> 



<div id="control-template"> 

    <!-- control markup inserted dynamically after each link --> 

    <div class="controls"> 

    <div class="statusbar"> 

    <div class="loading"></div> 

    <div class="position"></div> 

    </div> 

    </div> 

    <div class="timing"> 

    <div id="sm2_timing" class="timing-data"> 

    <span class="sm2_position">%s1</span>/<span class="sm2_total">%s2</span></div> 

    </div> 

    <div class="peak"> 

    <div class="peak-box"><span class="l"></span><span class="r"></span> 

    </div> 

    </div> 

</div> 



<div id="spectrum-container" class="spectrum-container"> 

    <div class="spectrum-box"> 

    <div class="spectrum"></div> 

    </div> 

</div> 







</body> 

</html> 

답변

1

비슷한 행동을 얻을 수 있었으면했다. 나는 이것이 조금 늦었다는 것을 알고있다. 그러나 잘하면 그것은 도움이 될 것이다.

다음 코드를 사용하여 SoundManager를 테스트합니다. soundmanager2.js, soundmanager2.swf 및 MP3 파일 경로를 변경해야합니다.

<html > 
<head> 
    <title></title> 

    <script type="text/javascript" src="/Project/PublicWebSite/Scripts/soundmanager2.js"></script> 
    <script type="text/javascript"> 
     soundManager.debugMode = true; 
     soundManager.defaultOptions.volume = 50 
     soundManager.debugFlash = true; // enable flash debug output for this page 
     soundManager.url = '/Project/PublicWebSite/Scripts/swf/soundmanager2.swf'; 
     soundManager.flashVersion = 8; // optional: shiny features (default = 8) 
     soundManager.useFlashBlock = false; // optionally, enable when you're ready to dive in 
     //enable HTML5 audio support, if you're feeling adventurous. iPad/iPhone will always get this. 
     //soundManager.useHTML5Audio = true; 
     soundManager.onready(function() { 
      soundManager.createSound('helloWorld', '/Project/PublicWebSite/Content/Sounds/Chime.mp3'); 
      soundManager.play('helloWorld'); 
     }); 
    </script> 

</head> 
</body> 
</html> 

BarDev