Adds an [audio] and a [sound] BBCode tag to Flarum.
An extension for Flarum which adds two BBCodes. One is
[audio] and it will turn a mp3, ogg, or wav URL into your browser's default audio player. The other is
[audio]URL to audio file[/audio]
composer require zerosonesfun/flarum-ext-audio:*
In addition to installing the main package with composer, download soundmanager2.min.js and inlineplayer.js from the assets folder of this repository. Upload those where ever you'd like. Then include the following script tags in your Flarum header. There is a custom header code area in your admin dashboard in the appearance section. You may add this in there. Or, if you're a Flarum expert, add them to your head (different from the header).
<script src="https://yoursite.com/path/to/soundmanager2.min.js"></script> <script src="https://yoursite.com/path/to/inlineplayer.js"></script>
Finally, add the inlineplayer.css (also located in the repository folder linked above) to your custom CSS box in your admin appearance settings.
Clear your cache.
Now you can use both the
[audio] tag and the
[sound] tag if you'd like. Or, just use one of them. The power is yours! If you use the
[sound] tag you will include the audio URL a little differently, like this:
[sound="https://example.com/boom.mp3"]Title Goes Here[/sound]