whisperwow I’d have to see the post and inspect the code. If you want to share a link I’ll take a look. Otherwise, it could have to do with caching. Is the little headphones icon showing?

It’s pretty hard to troubleshoot these things without seeing.

    whisperwow Ok, I see. Looks like this extension can't handle forums installed in a directory (i.e. your site.com/forum). I thought it could, but I guess not. The JavaScript included isn't pointing to the exact right spot. If your forum was installed at forum.yoursite.com or yoursite.com, it would work.

    Maybe one day a developer here will contribute to this extension and help fix that. 😸 Or, it's always possible that I'll find the energy one day to figure it out. It's just not a priority for me at the moment.

    Instead, because it's faster and easier for me personally, just like I did with the audio bbcode for you, I made a version for your forum. Hard to explain, but doing this is much faster for me than re-doing the existing extension. So, remove the existing one, and install this instead:

    composer require 2nrwls/flarum-inline-audio:"*"
    also run:
    php flarum cache:clear

    This worked great as well. Thank you very much for taking the time to do the version for my forum.

    Since I plan on officially launching my SongSport site in October, I'd be happy to maybe sponsor further development of this or the BB Code player extension that you developed. Since the "FOF Upload" extension already uploads a file to a local server or Amazon S3 and creates a valid .MP3 extension, is there a way to build or "extend" on that so that your Audio URL or BB Code player automatically takes that file name that is uploaded and put it into BB Code to display the player?

    Just food for thought.

    Thanks again and let me know if you're interested in discussing further.

    a month later

    Version 2.0

    • No new features
    • Code clean up
    • Had to remove the more complex BBCode audio player. It had a major bug. Sorry if anyone uses it. Just don't update if you really like it that much. But, the bug is that the code would repeat itself over and over sometimes. Might not be visible, but it was rather dirty behind the scenes. And so, this version is back to only being the original inline minimal player which is bug free. If you need a player with a progress bar try Essential Audio, or Audio BBCode.

    So I should remove this file via composer?

    composer remove 2nrwls/flarum-inline-audio:"*"

    I tried it but it says it doesn't exist.

    Also, will the 2.0 version work on "Forum" subdirectories?

      whisperwow I cleaned up that version as well. You may simply use the following command to update it:

      composer update 2nrwls/flarum-inline-audio:"*"

      For anyone else, the above is a custom version for whisperwow’s forum. It is only for forums installed at /forum.

      4 months later

      When I installed this extension, the FoF Upload stuff disappeared (no "My Media", no buttons available, etc.)

        CyberGene I think that’s a different extension causing that or you need to empty cache. Because, I have this installed at a live forum and those buttons are not missing.


          010101 well, could be a combination of extensions, but I always clean the Flarum cache and the browser cache after installing new extensions. After I removed this extension, the upload button reappeared... Not sure what it is but it's a bit difficult to debug that while my forum is live. Which leads me to another question, if it is possible to somehow create a "staging" copy of my forum to test stuff like that.

            CyberGene It’s possible. The SoundManager 2 library this uses could conflict with another extension’s JavaScript.

            As far as a staging environment, you’d have to look up how to install Flarum locally on your computer. Or, install another copy in some other ideally password protected directory on your server.

            010101 thanks, hopefully this gets solved because we’re a piano forum and would get use of an embedded player for audio files 👍🏻

              v3.0

              • Removed code to make as minimal as possible
              • JavaScript no longer served from public assets folder (this means more compatibility and less future bugs)
              • Changed from headphones icon, to play button (as far as the icon that shows in the post)
              • Clean, minimal, fast

              CyberGene: This version works around that Flarum core bug. The bug was due to how the JavaScript was loaded. Also, this helps to give you a solution to also allow users to download the audio if they want. Because, with this player you simply right-click on the link and download/save the audio file.

                Tested it, works great. I noticed something though. When I have a post with an audio URL and post it, there's no play button, only the URL, although the player works. I have to refresh the page to see the little play button in front of the URL, is that normal?

                  CyberGene Yeah that’s “normal” for this extension at least. 😁 But, let’s say immediately another user clicks on the post. They will see the play button. It’s a very temporary phenomenon that only the person who creates the post sees. And even then, the next time you view the post it’s there. 🤷‍♂️

                  And before anyone else comments who knows how to code Flarum extensions better than me. I know, there’s the oncreate vnode mithril stuff. It’s just, with the soundmanager audio library this uses, this was the best I could get it right now. 👍

                    010101 no problem, it’s OK. The extension works great on my forum now, thank you 🍻

                    a month later

                    Not sure when it stopped working, haven't paid attention but the only change recently is I updated some extensions and Flarum form 1.2 to 1.2.1, and I don't have the play button anymore... I haven't installed new extensions though. Not sure when exactly it stopped working though.

                      CyberGene I haven’t updated to the latest minor release of Flarum yet. But, I wouldn’t think it would break this.

                      Any errors in the browser’s dev console?
                      Did you empty both Flarum cache and browser cache?