MP3 Player

By James KanjoJames Kanjo


[[note]] Flashplayer ended 2020! See here the new code in html5 to use![[/note]]

As major web browsers remove support for flash, users wishing to embed audio should not use this component, but rather the HTML5 version.

Any existing uses of this component should move over as soon as possible.

Example page using the new component.

Code using the new component looks like this:

[[include :snippets:html5player
type=audio |
url=[URL HERE]

With the traditional MP3 Player, you need to manually inject your MP3's url into the html code. This also means you need an individual code block for each song you want to play.

This is very tedious, and frankly, too complicated for less advanced users. So I've expanded upon the original code, and made it possible to dynamically play songs as specified in the URL:


[[include :snippets:mp3
|URL=The link to your MP3 file goes here

To make the player automatically start playing when the page loads, just add an |autoplay= variable, and specify it to be true. For example:

[[include :snippets:mp3

The autoplay variable accepts both “true” and “yes” inputs

In action

Thanks to tsangk for this great snippet: conditional-blocks

text above inserted with:

[[include :snippets:if START |unique=1|type=equal|var1=%%name%%|var2=conditional-blocks]]
**##red|Thanks to tsangk for this great snippet:##** [[[code:conditional-blocks]]]
[[include :snippets:if END]]

Other snippets posted by James Kanjo

Extended NewPage Module - 15 Jul 2014 15:08
Specific Users Only Include - 24 Jul 2013 06:16
iframe Redirect - 30 Jul 2012 22:41
Per Category CSS Module - 06 Mar 2012 03:38
Video Player - 16 Feb 2012 01:50
Remove Duplications - 16 Feb 2012 01:39
RegExp Date Wizard - 16 Feb 2012 01:39
"Random Page!" link - 16 Feb 2012 01:35
Quoted Blockquotes - 16 Feb 2012 01:33
NewPage Button - 16 Feb 2012 01:26
JavaScript Addition - 16 Feb 2012 01:14
iframe embed - 16 Feb 2012 01:08
Random Page - 18 May 2011 09:50
Redirect - 11 Feb 2010 10:00

Rate this solution

If you think this solution is useful — rate it up!

rating: +49+x
Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License