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.
Not a member yet? Click here to register.
Forgot Password?

How to use MP3 BBCode in ver9?

Asked Modified Viewed 3,427 times
G
Grimloch
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Started this discussions
  • Answered 2 questions
asked
Senior Member

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:
[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:
".display_html("userform", "content", true, false, true, true)."
and for the BBCodes you would use:
".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.
Edited by Grimloch on 15-03-2020 08:48,
0 replies

2 posts

H
Harlekin
H
  • Member, joined since
  • Contributed 57 posts on the community forums.
  • Started 11 threads in the forums
answered
Member

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:
$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:
$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
1 reply
H
Harlekin
H
  • Member, joined since
  • Contributed 57 posts on the community forums.
  • Started 11 threads in the forums
answered
Member

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.
Edited by Harlekin on 15-03-2020 21:20,
1 reply

Category Forum

BB Codes - 9

Labels

None yet

Statistics

  • Views 0 views
  • Posts 2 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

A
A
  • Senior Member, joined since
  • Contributed 725 posts on the community forums.
  • Started 128 threads in the forums
G
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Started this discussions
  • Answered 2 questions
H
H
  • Member, joined since
  • Contributed 57 posts on the community forums.
  • Started 11 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet