Solved

mp3 player on WordPress/php

Posted on 2009-05-12
9
1,050 Views
Last Modified: 2013-12-07
I have spent way too much time trying to find a solution.  I want to use a stylish mp3 player on a wordpress site, where I can set parameters like the song list and if it will autoplay or not.  I set on up using a plugin (FMP) that uses JW's media player.  It is really nice, except I have to set it to autoplay or not throughout the site.

I want to have the home page autoplay and not the others.  You can see what I did at http://jandrentertainment.net/about.  That has the player that doesn't autoplay.  I can't figure out how to call the same player and then autoplay it on the home page.  This plugin has zero documentation, and I can't figure out how to manually call it.

I would love help on finding a nice solution, or a great guide for a skinned (with my background) player like the one on my site where it is easy to select the playlist and if it autostarts or not.
0
Comment
Question by:dougfosterNYC
  • 6
  • 3
9 Comments
 
LVL 25

Expert Comment

by:James Rodgers
ID: 24376581
here a few wp plugins you might be interested in

http://wordpress.org/extend/plugins/search.php?q=mp3+player
0
 

Author Comment

by:dougfosterNYC
ID: 24389365
Thanks Jester.

As I mentioned, I have tried most the plugins, so I am aware of how to search for them.  What i need is more specific help.  

What would be helpful is to find out how to call the JW media player manually, so that I can specify if it will be autoplayed or not.  

Or, find a specific solution that will allow me to easily call on a media player that will hold multiple songs, looks cool and is modifyable, and I can have it shuffle and/or autoplay.  

Any help?
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 24389483
the player you hve uses a config file located at
http://jandrentertainment.net/wp-content/fmp-jw-files/configs/fmp_jw_widget_config.xml

it looks like this

<mp3config>
<autostart>false</autostart>
<shuffle>true</shuffle>
<repeat>all</repeat>
<volume>50</volume>
<showdisplay>true</showdisplay>
<showplaylist>true</showplaylist>
<linktarget>_blank</linktarget>
<backcolor>0xFFFFFF</backcolor>
<frontcolor>0x000000</frontcolor>
<lightcolor>0xA81414</lightcolor>

<jpgfile>
http://www.jandrentertainment.net/music/jandraudio.png
</jpgfile>
</mp3config>

try changing autostart to true
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 24389564
if you want it to be page spcific you will need to alter a couple of file, inc the header.php file

each page has a unique id, what you can do is point to a new/alternate config file based on page id

<?php
if(is_home()){
point to auto play config
} else {
point to manual config
}

?>

problem is there are not a lot of options built in so you would need o create some of your own variables and test for them

this alos allows you to create custom play lists per page, you could point to different play list config files per page etc.

0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 25

Expert Comment

by:James Rodgers
ID: 24389699
something similar to this

<?php
if(is_home()){                                 // we are on the home page so do this
      var $playlistpath=
      var $configpath=
}else if is_single('post-slug') {  //it's a single post with the post-slug, can also use page title but these might be long
      var $playlistpath=
      var $configpath=
} else if (is_page('page-slug')){  //specific page can use page slug or page name, slug might be easier/cleaner
      var $playlistpath=
      var $configpath=
} else{                                        // absolute default setting when no other option tested true
      var $playlistpath=
      var $configpath=
}

?>

and then in your plugin change the output line to replace the config and playlist values with the values created above
also see hre for some conditions you can check for when determining outputs

http://codex.wordpress.org/Conditional_Tags
0
 

Author Comment

by:dougfosterNYC
ID: 24389756
Thanks Jester, this is the approach I need.
 
 I won't have time to test it now, but it makes sense for me to put something into the header.  My sense is that it would be done in place of the widget.  
 
 So, I already have a separate template for the home page which doesn't use the sidebar, but has it's own code in place of the sidebar.  So I can call the player from the template.
 
 I will set up the variables as you specify in the header to point to a different folder with the xml files (or different file names in the same folder) for the home page.

So in the home page template, in the sidebar section, what code do I use to call the player, or link it?  
0
 
LVL 25

Accepted Solution

by:
James Rodgers earned 500 total points
ID: 24394721
this is the code block the is generated by the plugin

using code similar to the condition block above

you would replace the paramaters given for the config file and playlist files

 
<?php
if(is_home()){                                 // we are on the home page so do this
      var $playlistpath=
      var $configpath=
}else if is_single('post-slug') {  //it's a single post with the post-slug, can also use page title but these might be long
      var $playlistpath=
      var $configpath=
} else if (is_page('page-slug')){  //specific page can use page slug or page name, slug might be easier/cleaner
      var $playlistpath=
      var $configpath=
} else{                                        // absolute default setting when no other option tested true
      var $playlistpath="http://jandrentertainment.net/wp-content/fmp-jw-files/playlists/fmp_jw_widget_playlist.xml?1649821582";
      var $configpath="http://jandrentertainment.net/wp-content/fmp-jw-files/configs/fmp_jw_widget_config.xml?2037294446";
}

?>

<ul>
                  <li id="fmp-jw-widget-428207761" class="widget fmp-jw-widget"><h2 class="widgettitle">Music</h2>

<div>
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="177" height="220">
        <param name="movie" value="http://jandrentertainment.net/wp-content/plugins/flash-mp3-player/player/player.swf?config=<? echo $configpath; ?>&amp;file=<? echo $playlistpath; ?>" />
    <!--[if !IE]>-->
    <object type="application/x-shockwave-flash" data="http://jandrentertainment.net/wp-content/plugins/flash-mp3-player/player/player.swf?config=<? echo $configpath; ?>&amp;file=<? echo $playlistpath; ?>" width="177" height="220">
    <!--<![endif]-->
        <param name="wmode" value="Window"/>
        <param name="quality" value="high" />
        <param name="allowFullScreen" value="true" />

        <param name="allowScriptAccess" value="always" />
        <param name="flashvars" value="config=<? echo $configpath; ?>&amp;file=<? echo $playlistpath; ?>" />
        <p>Here is the Music Player. You need to installl flash player to show this cool thing!</p>
    <!--[if !IE]>-->
    </object>
    <!--<![endif]-->
    </object>
</div>

        </li>            </ul>
0
 

Author Comment

by:dougfosterNYC
ID: 24395422
Thanks Jester, you rock!

It's up and running at http://jandrentertainment.net.


0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 24395561
glad i could help

thanks for the points
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
This video will give a brief orientation and organization of Logic Pro X, and how to access different work spaces quickly with keyboard shortcuts.
Viewers will get an overview of how to make and use Drum Racks in Ableton Live. Load new Drum Rack into empty MIDI track: Fill rack with audio samples: Re-arrange sample slots as necessary: Adjust parameters of each slot to tailor each sound a…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now