Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Audio Extension - Help

edited August 2006 in Vanilla 1.0 Help
I'd like to use the same concept as is present in the current ExtentedTextFormatter to convert a custom tag I have into OTHER html. For example. I want to have a tag like this. <mp3 src="my-music.mp3" title="my-song-title"> This is nice and simple for the the users to remember. I then want the extension to come through and wrap some object and embed code around that with the source of the object being something like this: player.swf?mp3=my-music.mp3&title=my-song-title... I really have no idea how to do this, so any guidance will be appreciated.


  • could this be as model?
  • Um... I am not sure. I did look into it and the actually flash application could be used (but I have a different one). I am not sure of the actual text/ tag replacement though. I would like to know how this is handled in Vanilla.
  • I still haven't been able to get this working. Can anyone lend a hand?
  • Have you try to do like the youtube tag
  • edited August 2006
    I had not seen that, so thanks.

    I think this regular expression should do the trick, although I am not entirely sure how to use it :P
    preg_replace('/\<youtube\>([a-zA-z0-9]+?)\<\/youtube\>/', '<object width="425" height="350"><param name="movie" value="$1"></param><embed src="$1" type="application/x-shockwave-flash" width="425" height="350"></embed></object>', $String); return $String;

    I would, however, like to have this as an extension like the ExtentedTextFormatter - as a standalone extension - rather than part of the BBCode StringFormatter.

    I would be using FULL URL's with the flash program I have, so, I would be giving it something like this: http://my-domain/some-music.mp3, instead of the "sdaqweo1fe" way of this solution, where only the move name is used, not a ful url.

    I am sorry for the vagueness of these requests, but I have never used Regular Expressions before and php is not my strong suit. I am a designer by trade.
  • I actually just got it working. I used a combination of the youtube tag and the extended text formatter. I will tidy it up tonight some time and try and have it ready for the add-ons page. I'll be using the following flash app to handle the music/ mp3's. I'll have it ready ASAP.
  • edited August 2006
    Nathan - Something to consider. That Wordpress mp3 player seems pretty cool. However, I know a concern of mine (and many users) will be the lack of audio control on the player itself. For example, I usually am out of reach of my speakers volume knob, and many songs/video clips/applications use varying levels of audio. Therefore, it is rather handy to be able to control each level of sound.

    Perhaps something more like this script might be more suitable:
  • I JUST saw that one myself. I am using a custom player myself, so the player I am going to package is not for me, it is for everyone else, so I will take a look and see how that one works. It is probably used in a similar fashion to the other ones. Thanks for the link though.
  • No prob. ;-)
  • There's another mp3 player called dew that a friend told me about.
  • jimw - I think this is what you were talking about? That one has even less control over the mp3 files themselves.
  • edited August 2006
    Here is the homepage of the dewplayer (fr). I wonder whether dew translated the text in english or not? Nonetheless, options are quite self-explanatory and the 2nd option of the form 'couleur de fond' means 'background-color'. For playing two or more mp3s, use 'multi' version and separate URLs with '|' (pipes).
    With these versions you can change the volume at once when creating the link but there are no options to change it while playing. It was intended to be a simple, usable, well-designed and quite light mp3 player, neither the lightest one nor Concorde cabin. :-)

    Adding a volume slider introduced a few problems in dewplayer-vol (1.5) like the need to stop the sliders from going to -300% or +500% and added a kB so he wasn't satisfied (but it does work). In case you need something more complex, it's not the best choice, mainly because the dewplayer #1 advantage is simplicity.
    (his work is under CC-license attribution and no derivatives work, just in case)

    A few more link to wonderful blindtests dew created with its dewplayer, in case you would want fresh ideas on blogs/forums: classical and movie themes blindtests (for the latter, 4, 6 and 8 are in french)
  • Oh - I found a different mp3 'Dew Player'. Bizarre.
    The one Felipe links to is much better.
  • lol you can make the volume go super loud ont hat dew player (one with volume control)
  • I am actually working on modifying my own player in the hope of releasing it with the extension. It would (hopefully) have volume control, have a little slider to change move o differnt parts of the audio track. If that fails, then I will use one of the other options you have posted that had the features you requested.
This discussion has been closed.