Search

I am trying to embed a flash mp3 player into my site that pulls an mp3 based on a path to that mp3 that I enter into a field in my Article form.

In my last site I was able to make it work by putting this where I wanted the song:

<xsl:apply-templates select="fields/song" />

And this at the bottom of the entries Utiliy:

<xsl:template match="fields/song"> <xsl:if test=". != ''"> <object type="application/x-shockwave-flash" data="[PATH TO FLASH PLAYER}" id="audioplayer1" height="24" width="290"> <param name="movie" value="[PATH TO FLASH PLAYER}" /> <param name="FlashVars" value="playerID=1&soundFile={.}" /> <param name="quality" value="high" /> <param name="menu" value="false" /> <param name="wmode" value="transparent" /> </object> </xsl:if> </xsl:template>

As I understand now though things are different in Symphony 2, and I am using a different player. I cant quite get it to work. This is the new player:

<embed src="{$root}/player/mp3player.swf" width="420" height="20" allowfullscreen="true" flashvars="&file=[PATH TO MP3]&height=20&width=420" />

I have no idea how to make this work so that it automatically takes what is in the field in my article form and puts it into the player. Can anyone help?

Replace [path to MP3] with {xml/path/to/node}.

I put "path to mp3" in there to simplify it. I couldnt figure out the path to the field in my article form. How do I do that part? I understand that if I put an absolute path to "http://aramdavid.com/workspace/audio/pensivethemeforromanticcomedy.mp3" it will play.. what I cannot understand is how to get it to pull the variable specific to the field IN symphony.

I am an idiot! That worked... I just know nothing about this stuff and had to play for a few minutes. THANK YOU SO MUCH!!!

aram could you eleborate on what kind of flash detect you use, and what would be a good player?

I am trying to find the site I grabbed it from, but cant. Though this is a great one:

http://www.macloo.com/examples/audio_player/

I use it on my site: http://www.aramdavid.com/music/

For loading Flash content you should be using SWFObject (http://code.google.com/p/swfobject/). It's the recommended method of Adobe, Google and the W3C. It's also rather simple which is a nifty bonus.

As for music player, you can do it all with a bit of ActionScript and the default components. Head to this site to get some video tutorials:

http://www.gotoandlearn.com/

One could also simply use a google flashplayer. Or do it more gracefully by using soundmanager as a javascript interface to flash.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details