• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

playing an MP3 on the forum

Kent

Active member
#2
You could use a standard flash-based MP3 player, or use HTML5 audio to play it.
Not all browsers support MP3 with the audio element out of copyright concerns, though, so you'd have to convert it to OGG.

One way you could do this is with a BB Code Media Site.
Media Site ID: html5audio (or just "audio")
Embed HTML:
Code:
<audio src="{$id}" controls>HTML5 Audio not supported</audio>
Then use it like so:
Code:
[media=html5audio]http://example.com/music/some.ogg[/media]
You may also want to show the file path and link to it, so users can see what it is before playing it.
 

Kent

Active member
#5
It seems XenForo transforms URLs on its own (wraps URL tags around it), even when using the BB Code editor. Quick work-around:
Code:
<audio src="http://yoursite.com/media/{$id}" controls>HTML5 Audio not supported</audio>
Then use:
Code:
[media=html5audio]music.ogg[/media]