开发者

Mysterious jPlayer 2.0.0 error on Firefox

开发者 https://www.devze.com 2023-02-25 15:09 出处:网络
My client has a page 开发者_如何学Pythonlisting his music here: http://bit.ly/flbgwm. Each song has its own player powered by jPlayer 2.0.0. They\'re working in Safari/Chrome, but not in Firefox, whic

My client has a page 开发者_如何学Pythonlisting his music here: http://bit.ly/flbgwm. Each song has its own player powered by jPlayer 2.0.0. They're working in Safari/Chrome, but not in Firefox, which uses Flash to play mp3's. I can't for the life of me figure out what's going on.

Here's an example of the code for one of the songs:

<div id="jquery_jplayer_1" class="jp-jplayer"></div>

<div id="jquery_jplayer_1" class="jp-jplayer"></div>
<div class="jp-audio">
    <div class="jp-type-single">
        <div id="jp_interface_1" class="jp-interface">
        <ul class="jp-controls">
            <li><a href="#" class="jp-play" tabindex="1">play</a></li>
            <li><a href="#" class="jp-pause" tabindex="1">pause</a></li>
            <li><a href="#" class="jp-stop" tabindex="1">stop</a></li>
            <li><a href="#" class="jp-mute" tabindex="1">mute</a></li>
            <li><a href="#" class="jp-unmute" tabindex="1">unmute</a></li>
    </ul>
    <div class="jp-progress">
            <div class="jp-seek-bar">
        <div class="jp-play-bar"></div>
        </div>
      </div>
      <div class="jp-volume-bar">
          <div class="jp-volume-bar-value"></div>
      </div>
      <div class="jp-current-time"></div>
      <div class="jp-duration"></div>
                  <a class="DownloadLink" href="[My download file]">download mp3</a>
      </div>
</div>

</div>


<script type="text/javascript">
  $(document).ready( function() {
        $("#jquery_jplayer_1").jPlayer({
            ready: function() {
              $(this).jPlayer("setMedia", {
                    mp3: "[The mp3 link]"
                });
            },
            play: function() {
                $(this).jPlayer("pauseOthers");
            },
            supplied: 'mp3',
            swfPath: 'custom/',
            cssSelectorAncestor: "#jp_interface_1"
        });
  });
</script>

Both the jPlayer javascript file and the jPlayer swf file are up to date, as are the paths above. Does anyone have any idea why this code wouldn't work in Firefox? I can't find any conflicts with any other script. (I'm using jQuery 1.5.1.)


It looks for the music relative to the SWF file in this case, not the html, because Firefox uses the flash version. It's possible it's not finding your music if you're using relative paths instead of an http link to the songs.

0

精彩评论

暂无评论...
验证码 换一张
取 消