如何使用fancybox播放mp3

时间:2013-11-11 21:43:09

标签: fancybox

我正在将fancybox添加到我的页面并显示不同类型的格式。我能够无缝地实现视频,文本和图像,但是当它没有加载音频时。点击图库上的音频文件后,它会在空白页面上打开。如果可能的话,我想尝试以iframe播放曲目。

<!-- Item Project and Filter Name -->
<li class="item-thumbs span3 music">
  <!-- Fancybox - Gallery Enabled - Title - Full Image -->
  <a class="hover-wrap" data-fancybox-type="iframe" data-fancybox-group="music"
     title="Breathin'" href="breathin.html">
    <span class="overlay-img"></span>
    <span class="overlay-img-thumb font-icon-plus"></span>
    <p class="description">
      <span class="title">Song</span>
    </p>
  </a>
  <!-- Thumb Image and Description -->
  <img src="_include/img/Breathin'200.jpg"alt="Breathin'">
</li>
<!-- End Item Project -->

我刚刚为我的音频文件添加了一个播放器,但我还没弄清楚如何将它们添加到fancybox。我想要以与上面相同的格式添加多个文件,其中显示图标,一旦按下fancybox将打开播放器。这是播放器,它完美无缺(在fancybox之外)。

<head>
<meta charset="utf-8">
<title>breathin.html</title>
<link type="text/css" href="plugin/blue.monday/jplayer.blue.monday.css" rel="stylesheet" />
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
  <script type="text/javascript" src="plugin/jquery.jplayer.js"></script>
  <script type="text/javascript">
    $(document).ready(function(){
      $("#jquery_jplayer_1").jPlayer({
        ready: function () {
          $(this).jPlayer("setMedia", {
            m4a: "_include/download/Breathin'.m4a",
            oga: "_include/download/Breathin'.ogg"
          });
        },
        swfPath: "plugin",
        supplied: "m4a, oga"
      });
    });
  </script>
</head>

<body>
  <div id="jquery_jplayer_1" class="jp-jplayer"></div>
  <div id="jp_container_1" class="jp-audio">
    <div class="jp-type-single">
      <div class="jp-gui jp-interface">
        <ul class="jp-controls">
          <li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
          <li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
          <li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li>
          <li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a> </li>
          <li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>
          <li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max volume</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-time-holder">
          <div class="jp-current-time"></div>
          <div class="jp-duration"></div>
          <ul class="jp-toggles">
            <li><a href="javascript:;" class="jp-repeat" tabindex="1" title="repeat">repeat</a></li>
            <li><a href="javascript:;" class="jp-repeat-off" tabindex="1" title="repeat off">repeat off</a></li>
          </ul>
        </div>
      </div>
      <div class="jp-title">
        <ul>
          <li>Breathin'</li>
        </ul>
      </div>
      <div class="jp-no-solution">
        <span>Update Required</span>
    To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
      </div>
    </div>
  </div>
</body>

任何人都有任何想法?   提前谢谢

0 个答案:

没有答案