Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

How to use MP3 BBCode in ver9?

I understand how to include BBCodes in a page and can actually set a url to an MP3. But at page display time I only get the code line itself as in:
CodeDownload  
[mp3]https://mp3url.com/music.xxx.mp3[/mp3]

... and that's all. The file doesn't play. What is the coding to display/play the mp3 file? I know that for a form html you would use:
CodeDownload  
".display_html("userform", "content", true, false, true, true)."

and for the BBCodes you would use:
CodeDownload  
".display_bbcodes("100px;", "content", "userform", "mp3")."

(the mp3 entry being the only thing I want to use in the edit form); but then on the display page how do you show/display/play the mp3?

Nevermind guys: Sorry I forgot about parseubb - Works fine.
The mp3 bbcode from V7 works with flash and flash need a manual activation in the browser to play. The Flash Player will be discontinued this year and the browser plugin will no longer be run in the future.

The solution would be an mp3 bbcode with the audio tag.

Open mp3_bbcode_include.php and replace:
CodeDownload  
$text = preg_replace('#\[mp3\](.*?)\[/mp3\]#si', '<strong>'.$lang['bb_mp3'].'</strong> <object type=\'application/x-shockwave-flash\' width=\'17\' height=\'17\' data=\''.INCLUDES.'HP_bbcodes/mp3player/mp3player.swf?&amp;song_url=\1\'><param name=\'movie\' value=\''.INCLUDES.'HP_bbcodes/mp3player/mp3player.swf?&amp;song_url=\1\'><param name=\'wmode\' value=\'transparent\'><param name=\'quality\' value=\'high\'><param name=\'bgcolor\' value=\'#eeeeee\'></object>', $text);


with:
CodeDownload  
$text = preg_replace('#\[mp3\](.*?)\[/mp3\]#si', '<strong>'.$lang['bb_mp3'].'</strong><br /><audio src="\1" controls="" controlslist="nodownload"></audio>', $text);



It works well for me
@Harlekin:
Hey man thanks this works great for me as well as shown in this image.
fortworthbonsai.org/my_stuff/mp3.jpg
... but I have a question. Is there a way to change the bgcolor of the player background?
I haven't dealt with that yet. This is probably browser dependent. Take a look at the player with Firefox, Edge, Opera or Chrome, it looks different.
Yeah I see what you mean. I researched audio tag attributes and settings and bgcolor is not an option. Not a problem; as I use Firefox I simply enclosed the player in a table cell w/bgcolor. Take a look if you'd like.
https://fortworthbonsai.org/user_page...php?user=1
Looks great, nice work.
Thread Information
Author
Posted In
Replies
6 posts
Views
2273 times
Last Post
Last updated on 6 months ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: afoster, Grimloch, Harlekin