• Is it possible to play whole media library in this player? I have 300 mp3 files, which i want to play on one page.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author simon.ward

    (@simonward-1)

    Yes absolutely, but you need to use the template tags. Assuming you have no playlists anywhere, you can do it like so:

    put this code in header.php above wp_head():

    <?php
    if ( function_exists('mp3j_addscripts') ) {
    	mp3j_addscripts();
    	mp3j_flag();
    }
    ?>

    then put this where you’d like the player to go (eg. sidebar.php):

    <?php
    if ( function_exists( 'mp3j_grab_library' ) ) {
    	$lib = mp3j_grab_library();
    	mp3j_set_meta( $lib['filenames'] );
    	mp3j_put( 'feed' );
    }
    ?>

    that should be it.
    Simon

    Thread Starter jancek

    (@jancek)

    And, is it possible to shuffle songs each time the player reload?

    Plugin Author simon.ward

    (@simonward-1)

    Yes just insert this in the sidebar code above:

    shuffle( $lib['filenames'] );

    so that chunk becomes:

    <?php
    if ( function_exists( 'mp3j_grab_library' ) ) {
            $lib = mp3j_grab_library();
            shuffle( $lib['filenames'] );
            mp3j_set_meta( $lib['filenames'] );
            mp3j_put( 'feed' );
    }
    ?>

    Simon

    Hi Simon,

    Thank you for your work on this plugin – i am a big fan of Zina as an MP3 music manager, but unfortunately it only has a flash-based embedded player. (I’m hoping Zina’s author will use Jplayer in the near future)

    In the meantime, and for pages where I don’t need all the complexity of a library tool, your plugin is great to create a solution that works for mobile and traditional devices.

    However, there is on thing that Zina and some other players do that I think would be wonderful if you could include – wouldn’t it be possible to just read the ID3 tags in the MP3 file for title, artist, etc. rather than having to add these as custom field for each song?

    Thanks!

    Plugin Author simon.ward

    (@simonward-1)

    unfortunately this is not as simple as it maybe should be.

    jquery.jPlayer itself does not support reading of ID3 tags as is, and from what i can tell Happyworm won’t be adding this anytime soon due to various complications with flash and current html5 support from browsers.

    The tags could be read separately, but it means more scripts and more loadtime/bandwidth, and each of the files in a long playlist would have to be accessed to get this info, which will slow things down.

    btw if you keep your tracks in the WordPress library you’ll never have to enter title/artist more than once, but i appreciate that for playing off-domain mp3’s if you want anymore than a filename displayed it requires some additional typing!

    Should things get any simpler with ID3 tags i will look again at adding support for them.

    Simon

    HI Simon,

    Thanks for the response – makes sense.

    If you do decide to pursue it, Ryan at pancake.org might have insights from his work with Zina and the embedded player he uses. What would be really cool (for me 😉 ) is if you guys joined forces and were able to jplayer-ize Zina 😉

    Anyway, thanks!!

    This code is not working for me ….. can u please help me out???

    Plugin Author simon.ward

    (@simonward-1)

    @anumghaznavi,
    this is old code used for version 1.4.x, please see new help in plugin for a template tag example that can be used in version 1.7. It’s now easier.

    Simon

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: MP3-jPlayer] Play whole media library’ is closed to new replies.