Solved

mp3 player on WordPress/php

Posted on 2009-05-12
9
1,051 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
Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
This video will demonstrate how to customize windows, tools, and control bars, and save them as screen sets. Open and resize windows: Customize the toolbar: Customize the control bar: Customize your tool selections: Your screen set is alread…

910 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

20 Experts available now in Live!

Get 1:1 Help Now