?
Solved

mp3 player on WordPress/php

Posted on 2009-05-12
9
Medium Priority
?
1,057 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
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.
Viewers will learn the basics of creating custom device Racks in Ableton Live. Place instrument(s) and effects onto a track, and select them all by holding the Shift key and clicking on the device title bars: Group them by typing Command-G (Ctrl-G…
Suggested Courses

764 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