playing an MP3 on the forum

AndreaMarucci

Well-known member
I've an MP3 file I would like to attach to a post and let all other users to hear it. Is it possible to do that?
 

Kent

Active member
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.
 

AndreaMarucci

Well-known member
Sorry but I've not understood what I've to do...

appeared like

Code:
[media=audio][url]http://example.com/music/some.ogg[/url][/media]
 

Kent

Active member
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]
 
Top