PHP & JavaScript Room :: 設置サンプル

実行結果

設置サンプル

jPlayerの見た目をカスタマイズ。音声のメディアフォーマットは、mp3のみを指定。自動再生なし。

参照:jPlayer 2.1.0

音楽素材:コーヒータイム

プレーヤー素材:Free PSD: Custom Audio Player Skin | Premium Pixels
音素材:ドラムの音 - コーヒータイムさん

設置サンプルのソース

<!DOCTYPE html>
<html>
   <head>
      <meta charset="utf-8" />
       <title>設置サンプル</title>
      <link rel="stylesheet" type="text/css" href="/content/lib/global.css" />
      <!-- CSS -->
      <link rel="stylesheet" type="text/css" href="/content/lib/jquery/jplayer/skin_audio/custom.css" />
      <!-- JS -->
      <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" ></script>
      <script type="text/javascript" src="/content/lib/jquery/jplayer/jquery.jplayer.min.js" ></script>
      <script type="text/javascript">
         $(function(){
            $("#audio_player").jPlayer({
               /* イベントハンドラ */
               ready: function(){
                  /* 再生するメディアの定義 */
                  $(this).jPlayer("setMedia", {
                     mp3: "/content/media/audio/Q701.mp3"
                  })//.jPlayer("play");
               },
               /* 音量 */
               volume: 0.3,
               /* リピート再生 */
               ended: function (event) {
               //   $(this).jPlayer("play");
               },
               /* Jplayer.swfのパス */
               swfPath: "/content/lib/jquery/jplayer/",
               /* フォーマット優先度 */
               supplied: "mp3"
            })
            .bind($.jPlayer.event.play, function() {
               $(this).jPlayer("pauseOthers");
            });
         });
      </script>
   <link rel="stylesheet" type="text/css" href="/common/css/example.css"></head>
   <body id='example3' class='example'><div class="ads" style="margin:32px auto;text-align:center;"></div><h1 class='h'><a href='/'>PHP &amp; JavaScript Room</a> :: 設置サンプル</h1>
<h3 class='h'>実行結果</h3>
      <div id="wrap">
         <h1>設置サンプル</h1>
         <p>jPlayerの見た目をカスタマイズ。音声のメディアフォーマットは、mp3のみを指定。自動再生なし。</p>
         <p>参照:<a href='http://www.jplayer.org' target='_blank'>jPlayer 2.1.0</a></p>
         <p>音楽素材:<a href='http://maiise.dtiblog.com/blog-entry-2346.html'>コーヒータイム</a></p>
<!-- CODE -->
<div id="audio_player" 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="#" 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" title="mute">mute</a></li>
            <li><a href="#" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>
            <li><a href="#" 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>
      <div class="jp-title">
         <ul>
            <li><a href='http://maiise.dtiblog.com/blog-entry-2346.html'>ドラムの音</a> - コーヒータイム</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>
<!-- / CODE -->
         <p>プレーヤー素材:<a href='http://www.premiumpixels.com/freebies/custom-audio-player-skin-psd/'>Free PSD: Custom Audio Player Skin | Premium Pixels</a><br>音素材:<a href='http://maiise.dtiblog.com/blog-entry-2346.html'>ドラムの音</a> - コーヒータイムさん</p>
      </div>
   </body>
</html>