• Resolved khanvict

    (@khanvict)


    Hi,

    I activated the mp3-jplayer plugin on my site and I can get the player itself to load but it’s not loading the tracks from the directory I’m specifying.

    I’m using this shortcode in the post where I want it:
    [mp3-jplayer tracks=”FEED:/uload/audio/001″]

    I know the directory path is correct because in the mp3-jplayer settings I have the option to set the default directory if I want and when I use that path it does show me that I have the mp3 there. I don’t need to set default directory though.

    site is at https://onefourteen.org and the player is under ‘suwar’ (001).

    Any help?

Viewing 5 replies - 1 through 5 (of 5 total)
  • One reason (maybe not the only one) is that this line in the html:

    <div style="position:relative;"><div id="jquery_jplayer"></div></div>

    is getting hidden inside those toggled menus (which it doesn’t like), it always gets added along with the first player written to the page. As a work-around you could try the following:

    1) comment out line 1237 of mp3j_main.php (version 1.7.1), it’s this one:

    echo "\n<div style=\"position:relative;\"><div id=\"jquery_jplayer\"></div></div>\n";

    2) add this once, somewhere below the opening body tag in the template file:

    <div style="position:relative;"><div id="jquery_jplayer"></div></div>

    you might want to add it a couple of divs below the body tag but make sure it’s before you’re into the hidded expandable divs.

    If it works i’ll try sort something out for next version.

    Simon

    Thread Starter khanvict

    (@khanvict)

    thanks for your time and suggestion simon. i commented out that line as you instructed in part one and then placed that snippet from part two in several different places throughout the body and divs of the template but with unfortuantely no success. those toggled menus do make things tricky but i’m really hoping to figure something out.

    could i simply be having the same issue as this person here is?:
    https://www.ads-software.com/support/topic/the-player-is-displayed-but-no-tracks-appear?replies=4

    i will quote his post,

    “Ok, i found the problem. When the plugin search for jquery, didnt found my 1.6.1 version…

    When the script adds the jquery library? I need to load the 1.6.1, not the plugin version.”

    and then goes on to say the problem was resolved but not sure if that was indeed the actual problem and or what his resolution really was. i don’t even know how to do what he’s describing.

    Thread Starter khanvict

    (@khanvict)

    after spending a lot of time with trying to figure this out i feel like i’ve gotten to the source but could still use some help. it seems to me the problem is probably similar to what was described in the last post about loading the jquery stuff because what i noticed is the following:

    in my header when i remove:
    <script src="https://code.jquery.com/jquery-latest.js" type="text/javascript"></script>

    then mp3-jplayer works fine but then my posts do not have their toggle effect because it loads the dependencies from that from jquery src.

    so it seems to me that the conflict lies in it trying to load jquery twice (once in my header and then probably again in the mp3-jplayer plugin)?

    here is where jquery gets loaded in the plugin (mp3j_main.php):

    // jQueryUI components/dependencies
    			if ( $version >= 3.1 ) {
    				wp_enqueue_script( 'jquery-ui-progressbar', '/wp-content/plugins/mp3-jplayer/js/ui.progressbar.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse' ), '1.8.10' );
    				wp_enqueue_script( 'jquery-ui-slider', '/wp-content/plugins/mp3-jplayer/js/ui.slider.js', false, '1.8.10' );
    			}

    I don’t know what to change here without messing anything up.

    Thread Starter khanvict

    (@khanvict)

    FINALLY RESOLVED

    It did turn out to be the jquery conflict with the plugin. Here’s what I did:

    1) Commented out my script src tag to load jquery in my header

    <!-- <script src="https://code.jquery.com/jquery-latest.js" type="text/javascript"></script> -->

    so i’m not using this right now.

    2) Added jQuery.noconflict() to the toggle script in my header and replaced where it used to have ‘$’s with ‘jQuery’

    example: $(document.ready(function() { is now:

    <script>
    jQuery.noConflict();
    jQuery(document).ready(function() {
    // ordered list stuff
    jQuery("ol li:first").addClass("first");
    jQuery("ol li:last").addClass("last");
    
     // hides the post content
    jQuery('.expand').hide();
     // toggles the post content on clicking the noted link
      jQuery('a.moreless').click(function() {
        jQuery(this).closest('.post').find('.expand').toggle(400);
        return false;
      });
    });
    
    </script>

    I don’t know if this is the technically correct way to do it but the player and my toggled divs are now working in harmony and I do not seem to be having any other issues.

    I guess my suggestion for future releases of this plugin, if at all possible, would then be to have it to where the plugin itself is using some sort of jQuery noconflict rather than us having to modify something in our template. I think this would save a lot of us novices much headache and future woes.

    Thanks again for this awesome plugin. I’m glad I can use it now ??

    Hi, im having a similar problem. im building a music site where i need to put some music in to posts.. and i have tired most the short code. the player loads but no playlist shows nothing happens. the files do exsist becuase in settings where to type in the url of defualt folder it shows me i have mp3 files in there. i am struggling so much to get this to work, and i am new to all this. can some one help me?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: mp3-jplayer] – Won't load or list mp3s’ is closed to new replies.