Javascript SoundManager2 问题

发布于 2024-10-06 04:59:22 字数 2621 浏览 4 评论 0原文

我试图让这个播放器在您单击轨道时基本上开始和停止。我在这方面失败得很惨。有人以前用过这个并且可以给我一些帮助吗?我希望让它的行为类似于 http:// www.schillmania.com/projects/soundmanager2/demo/page-player/basic.html

    <!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>

I am trying to get this player to basically just start and stop when you click the track. I have failed miserably at this. Has anyone used this before and can give me a little help? I was hoping to get it to act similar to this http://www.schillmania.com/projects/soundmanager2/demo/page-player/basic.html

    <!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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

与酒说心事 2024-10-13 04:59:22

我正在寻找 SoundManger 的另一个问题的解决方案,并发现了这个问题。我知道这有点晚了,但希望它会有所帮助。

我使用以下代码来测试 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>

酒吧开发者

I was look for a solution to a different problem with SoundManger and found this question. I know this is a little late, but hopefully it will helps.

I use the following code to test SoundManager. You will need to change the paths to soundmanager2.js, soundmanager2.swf, and the MP3 file.

<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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文