Solved

mp3 player on WordPress/php

Posted on 2009-05-12
9
1,052 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
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 
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
 
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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
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…
The viewer will learn how to dynamically set the form action using jQuery.
Viewers will learn how to create and use Simpler instruments in Ableton Live. Load new Simpler into an empty MIDI track: Select a sample and drop it into sample window in Simpler: If sample is not pitched at C3, adjust tuning with Transpose para…

770 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