MP3 made simple

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

MP3 made simple

Post by Rolf »

Create an UDT called 'mp3' with the content:

Code: Select all

echo '<embed type="application/x-shockwave-flash" flashvars="audioUrl=' . ($params[file]) . ' "src="http://www.google.com/reader/ui/3523697345-audio-player.swf" width="400" height="27" quality="best" style="z-index:0;" wmode="transparent"></embed>';
You call this UDT in a page like:

Code: Select all

{mp3 file="path/to/file.mp3"}
Or

Code: Select all

{mp3 file="http://www.buispost.eu/path/to/file.mp3"}
Example: http://historisch.zeijen.nu/radio-omroep-zeijen

Grtz. Rolf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
micahgodbolt
Forum Members
Forum Members
Posts: 149
Joined: Thu Jul 29, 2010 11:09 pm
Location: Portland, OR

Re: MP3 made simple

Post by micahgodbolt »

Nice tip! Certainly a nice quick, light option for hosting mp3 files without installing some big module.
merrony
New Member
New Member
Posts: 7
Joined: Thu Oct 08, 2009 10:19 am

Re: MP3 made simple

Post by merrony »

Thank you so much! None of the module-based players seem to work reliably (possibly due to postgresql) and this does the job quickly and easily.
Kareng
New Member
New Member
Posts: 3
Joined: Tue Jul 26, 2011 1:32 am

Re: MP3 made simple

Post by Kareng »

I'm trying to use this solution to embed an audio player on my church's website. It's not working for me. I'm not a developer so please bear with me as I explain what's going on.

First some background: I successfully iframed a Google calendar onto one of our pages by going into CMS, opening the page, going to the HTML source editor and copying the iframe coding for the google calendar. It's working well: http://www.christchurchuccft.org/events.html

I assumed it would be similar for embedding the google reader audio player. I uploaded my audio files to Amazon S3, inserted the URLs into the code, opened our home page in the CMS, went to HTML source editor, copy and pasted the code, and hit "update." Alternatively I have also just turned off the wysiwyg editor and tried to paste the code there and "Submit." In every case, the code doesn't stay in the file after I save it. Nothing is embedded. When I go back into HTML source, the code I had copied and saved is gone.

What am I doing wrong? Is embedding of players somehow turned off for our pages, and how can I change that in the admin? (I didn't set up the site, but I have been poking around in it for a while.)

Here's the code I have been trying to paste:

<embed type=”application/x-shockwave-flash” src=”http://www.google.com/reader/ui/3523697 ... player.swf” flashvars=”audioUrl=http://praisebandaudiofiles.s3.amazonaw ... lyAway.mp3
” width=”400″ height=”27″ quality=”best”></embed>

Do I need to paste it elsewhere on the site, not directly into the page where I want the player to appear? Is there something wrong with my Amazon s3 setup perhaps? Sorry for all the dumb questions. :-) Thanks for any help.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: MP3 made simple

Post by Rolf »

Hi Kareng

Try to rename you sound file: I'llFlyAway.mp3 and remove the '
For example iwillflyaway.mp3

Hope this helps,

Rolf :)
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Kareng
New Member
New Member
Posts: 3
Joined: Tue Jul 26, 2011 1:32 am

Re: MP3 made simple

Post by Kareng »

Thanks, I'll try that. I'm pretty sure I tried other files already that didn't have an apostrophe, but I'll definitely give it a try.
User avatar
fearmydesign
Power Poster
Power Poster
Posts: 363
Joined: Sun Feb 28, 2010 10:54 pm

Re: MP3 made simple

Post by fearmydesign »

Thank you, this works perfect!
I have a question, is there a way to de-active some controlers to adjust for a smaller width? for example, I wanted to make the width only 150px for a small window, but I only want to show the 'Play' & 'Pause' buttons for example, is this possible? or is there a compressed version of the player?

For now I just placed it in the body of my content where the width is 600px so its look good.

Thank you
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: MP3 made simple

Post by Rolf »

@fearmydesign
I Googled this http://muzso.hu/2006/09/27/flashvars-fo ... gle-videos

grtz. Rolf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Post Reply

Return to “Tips and Tricks”