Note that there are some explanatory texts on larger screens.

plurals
  1. POJplayer grabs mp3 file but doesn't play it
    primarykey
    data
    text
    <p>I'm trying to use jplayer to play mp3 files added in custom fields. So when I click on the mp3 file in the post jplayer grab the mp3 files, but so far it only show the name of the file and the artist, but I can't get it to actually play the file.</p> <p>I use this code on single.php:</p> <pre><code>&lt;div class="mp3jplayer-track"&gt; &lt;a class="playprogram" href='javascript:initMp3("&lt;?php echo $mp3_url; ?&gt;", "&lt;?php echo $mp3_name; ?&gt; - &lt;?php /*if there is an artist specified for each mp3, we get it, otherwise we get the taxonomie Artists*/ if ($mp3_artists != ''){ echo 'Artist(s): '.$mp3_artists;} else { echo 'Artist(s): '.$artists_names; } ?&gt;")'&gt;Play &lt;br&gt;&lt;span class="mp3_name"&gt;&lt;i class="icon-music icon-white"&gt;&lt;/i&gt;&lt;span class="mp3_name_text"&gt;&lt;?php echo $mp3_name ?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; &lt;/div&gt; </code></pre> <p>The jplayer looks like this in my footer:</p> <pre><code>&lt;div id="jp_container_1" class="jp-audio"&gt; &lt;div class="jp-type-single"&gt; &lt;div class="jp-gui jp-interface"&gt; &lt;ul class="jp-controls"&gt; &lt;li&gt;&lt;a href="javascript:;" class="jp-play" tabindex="1"&gt;play&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="javascript:;" class="jp-pause" tabindex="1"&gt;pause&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="javascript:;" class="jp-stop" tabindex="1"&gt;stop&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;!-- &lt;ul class="jp-toggles"&gt; &lt;li&gt;&lt;a href="javascript:;" class="jp-repeat" tabindex="1" title="repeat"&gt;repeat&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="javascript:;" class="jp-repeat-off" tabindex="1" title="repeat off"&gt;repeat off&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; --&gt; &lt;div class="jp-progress-group"&gt; &lt;div class="jp-current-time"&gt;&lt;/div&gt; &lt;div class="jp-progress"&gt; &lt;div class="jp-seek-bar"&gt; &lt;div class="jp-play-bar"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="jp-duration"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class="jp-volume-group"&gt; &lt;a href="javascript:;" class="jp-mute" tabindex="1" title="mute"&gt;mute&lt;/a&gt; &lt;a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute"&gt;unmute&lt;/a&gt; &lt;div class="jp-volume-bar"&gt; &lt;div class="jp-volume-bar-value"&gt;&lt;/div&gt; &lt;/div&gt; &lt;a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume"&gt;max volume&lt;/a&gt; &lt;/div&gt; &lt;div class="jp-time-holder"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="jp-title"&gt; &lt;ul&gt; &lt;li&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="jp-no-solution"&gt; &lt;span&gt;Update Required&lt;/span&gt; To play the media you will need to either update your browser to a recent version or update your &lt;a href="http://get.adobe.com/flashplayer/" target="_blank"&gt;Flash plugin&lt;/a&gt;. &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>And the javascript to load the mp3:</p> <pre><code>function initMp3(mp3file, mp3info){ jQuery.noConflict()(function($){ /* DEBUG window.alert(mp3file); window.alert(mp3info); */ $("#jp_container_1").css("display","block"); $("#jquery_jplayer_1").jPlayer( "clearMedia" ); $("#jquery_jplayer_1").jPlayer( "setMedia" , { mp3:mp3file }); $("#jquery_jplayer_1").jPlayer({ ready: function () { $(this).jPlayer("setMedia", { mp3:mp3file }).jPlayer("play"); }, swfPath: "js", supplied: "mp3", wmode: "window" }) $(".jp-title ul li").text(mp3info); $("#jquery_jplayer_1").jPlayer("play"); }); }; </code></pre> <p>I really searched but I can't find why it doesn't work, any idea?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload