Viewing 15 replies - 1 through 15 (of 22 total)
  • jplayer 2.1 – what kind of new “goodies” in there?

    Thread Starter HelgaTheViking

    (@helgatheviking)

    check out the demos:
    http://jplayer.org/latest/demos/

    i think the playlist feature looks a lot better. but a big part of the update would be improving the script loading, (i think, i haven’t actually confirmed this needs to be done) and just making sure it still works well with WP. i sent simon a message to ask whether he is still maintaining this, but haven’t heard back yet.

    Thanks, I LOVE the button: http://jplayer.org/latest/demo-05/ but with NO background, and smaller…

    Maybe he is dead? I hope not!

    Thread Starter HelgaTheViking

    (@helgatheviking)

    i did hear back so he’s thankfully still alive, just busy. i like the ability to display cover art w/ the playlists w/ the new jplayer.

    Any news? It’s 2012 already… šŸ˜›

    I really like the way it works. I have my music linked from an s3 account wish the plugin would preload (progressively download I mean) playlists at least visually more rapidly. Fetching songs though has not been a problem though. The plugin even validate as valid xhtml. All in all I’m happy with it guess this is more of a feature request. The fact that it obscures links is great saves a lot of amateur (that’s me) type headaches.

    Example Deployment:
    And while it lasts the validation link

    Really Simon Ward whoever you are thanks a lot!

    Thread Starter HelgaTheViking

    (@helgatheviking)

    @dale totally agree. simon put together an awesome plugin that despite not being updated in ages, still just plain works. thank you simon!

    Maybe you can help me with the following?

    Put this in header.php above wp_head()

    <?php
       mp3j_addscripts();
     ?>

    In Template Tag Help I read:
    Always use if ( function_exists() ) {} to check tags exist before running them incase the plugin gets deactivated.

    What does the final php code should look like? Thank you

    Thread Starter HelgaTheViking

    (@helgatheviking)

    i don’t know why instructions say that any more. just add it to the wp_head hook, that way you don’t have to hack header.php

    add to your functions.php

    function add_m3j(){
      mp3j_add_scripts();
    }
    add_action('wp_head','add_m3j');

    Thanks for this helgatheviking, I will try it later on.

    I Googled and came across this post:
    http://wordpress.org/support/topic/plugin-mp3-jplayer-works-well-customizable?replies=32#post-1810928

    What do you think about the following — not needed anymore then?

    <?php if ( function_exists('mp3j_addscripts') ) { mp3j_addscripts('/wp-content/plugins/mp3-jplayer/css/mp3jplayer-green-sidebar.css'); } ?>
    
    <?php mp3j_put(107); ?>

    PS: I think there is a typo in your code — shouldn’t it be:
    mp3j_addscripts();

    Instead of:
    mp3j_add_scripts();

    ?

    Thread Starter HelgaTheViking

    (@helgatheviking)

    if that is the correct function name, then yes that’s what it should be. consider my code more of an example of how to add code to the header… or even more generically how to add anything to any hook.

    i don’t really know what you’re asking in your other reply. i’m not exactly an expert in this plugin.

    Thank you, your input is truly appreciated, even though your code did not work.

    All I was asking/saying, is that the doc recommended using something like: if ( function_exists() ) {} …

    So I googled and eventually came across the example from an other thread.
    You suggested something different, and you also said that you did not know why the instructions said that anymore , I assumed and understood that in your opinion the code was dated/no needed anymore — that’s what I meant by “not needed anymore?”

    Otherwise, does the following code makes sense to you?

    if ( function_exists('mp3j_addscripts') ) {
    mp3j_addscripts(); }

    I came up with it by analysing the code I pasted from the other post.

    Thanks again

    Thread Starter HelgaTheViking

    (@helgatheviking)

    it is always a good idea to check if a plugin’s function exists before adding it. this prevents errors in case the plugin is deactivated. so add your code to the header in the same way that i have shown.

    i don’t know what the mp3j_addscripts function does precisely so i can’t say if it itself is outdated. but directly editing header.php is outdated when every theme in the repo has the wp_head hook you can attach a function to.

    Thank you again for your reply.

    I understand the principle of what you have explained and what it does.
    However, I am not that clued up with php. All I am able to do is copy and paste stuff really.

    So, a couple of questions, in case you know a thing or two;
    1. Where did you get the function “add_m3j” from and are you sure that it is up to date? I am interested as I did not see it mentioned in the doc.

    2. In your opinion what should I put in my functions.php then? Possibly I’d like to “merge” your code with mine above. Considering the following from the doc:

    Template Tags

    Tags have become easier since version 1.7, you can now send in shortcodes. Note: there’s an admin option to ignore the tags which needs to remain unticked when you want to use them.

    Instructions: Place tag (1) in the header, place tag (2) where you want the players to be.

    (1). mp3j_addscripts( $style )

    Loads the player’s javascript and CSS files into the page header, and allows you to set a stylesheet. This tag must be placed above wp_head(), and must be used to ensure scripts will be loaded for players set via template tags.

    $style can be either a URI to a stylesheet, or ‘styleA’, ‘styleB’, ‘styleC’, ‘styleD’ to use one available from admin. Defaults to current admin setting if not specified.

    (2). mp3j_put( $shortcodes )

    Adds player(s) where the tag is placed in the theme. Can use multiple times.

    $shortcodes is a string containing any player shortcodes and html

    Example

    Play 5 random library tracks on the posts index page

    Put this in header.php above wp_head()

    <?php
       mp3j_addscripts();
     ?>

    Put this in index.php

    <?php
       mp3j_put( '[mp3-jplayer tracks="FEED:LIB" pick="5"]' );
     ?>

    Always use if ( function_exists() ) {} to check tags exist before running them incase the plugin gets deactivated.

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘[Plugin: MP3-jPlayer] Anybody up for updating this to use jplayer 2.1?’ is closed to new replies.