ColdFusion, WordPress, Flash & other web things


Tutorial for using Audio Player on non-WordPress sites

Good news for people who want to use my Audio Player on a non-WordPress site: Mindy McAdams has very kindly written a nice tutorial explaining exactly how to do it.

Thanks Mindy!

76 comments

  1. #1: Oddible Says:

    I don’t support there is a way to script the player to automatically begin playing the audio without a user click?

  2. #2: Rekzai Says:

    Hi, ever since I upgraded my wordpress to the latest version audio player stopped working :( please helppp

  3. #3: MTweb Says:

    I’ve been looking for an audio player for a while now and have experiemented with a few. Yours is, I have to say, the easiest to impliment by far! Thank you for the priviledge!

    Some questions: How accessible is it? Can it be make more accessible by adding some alt/title code somewhere? (Please excuse my ignorance but I’m not very knowledgable about this - just want to make it widely useable)

    Cheers

  4. #4: nas Says:

    do you have a mac version of audio player?

  5. #5: Oddible Says:

    A Mac version? It’s Macromedia Flash - as long as the client machine has Flash player installed it should work on Windows or Mac.

  6. #6: Adele Says:

    how can i use it in msn live space?

  7. #7: Martin Says:

    Adele: I have no idea. I don’t use msn live.

  8. #8: Mike Says:

    Martin,

    Thanks for the tut.

    I was wondering if there were any javascript functions to start and pause programatically? I was also wondering if it was possible to get a function to return the current on the player.

    I wanted to see if I can exploit the player a little bit.

    Please let me know.

  9. #9: Mike Says:

    Martin? any pointer?

  10. #10: Martin Says:

    Mike. No, there isn’t a javascript API for the player. I might add one to it when I release version 2.

  11. #11: Mike Says:

    Okay, great. Thanks for your time.

  12. #12: daniel Says:

    It didn’t work for me.

    I have many mp3 links dynamicly updated
    and I whant a scripts automaticly manage them

    add to play list
    and draw interface instead of links

    Does anybody knows solution for that?

  13. #13: Jonny Says:

    This is the neatest player i have seen. One thing I was searching for was when you have multiple players on one page - starting one would cease the current one playing. This one does - and it’s excellent. I little volume control might be cool too but not essential. Thanks very much!!
    J

  14. #14: Joe Says:

    Can I embed the player into a Flash presentation? How would I script it into a Flash window?

  15. #15: Jonny Says:

    Hi - on our site http://www.yopo.co.uk - with MS Internet Explorer you have to click on the player to select it - and then click again to make it play. With Firefox you just click and off it goes. Is there any way to stop this happening in IE?

    Thanks, J

  16. #16: Martin Says:

    Joe: there is no easy way to embed the player in another flash movie.

  17. #17: Martin Says:

    Jonny: you need to use a method such as SWFObject or UFO. Version 2 will use such methods (the WordPress plugin anyway).

  18. #18: Han Says:

    I am preparing a new website wtih wordpress an your nice plugin.
    The one that uses it mentioned that he can not open it on his new Apple, but it works on his his old Apple. I prseume that can be a problem with a missing Flash plugin. Which is the lowest version that works? So I can check whether I need an other solution.

  19. #19: Martin Says:

    Han: you need at least Flash 6

  20. #20: Josh Says:

    Has anyone had any success with using this player for .m3u’s? The author of this post (http://www.1pixelout.net/2006/09/04/minor-update-to-audio-player-for-wordpress/) mentions that he can use the player with links to .m3u files, but I can’t get it to work…

    Otherwise the plugin is fantastic.

    Any ideas?

    Thanks,
    Josh

  21. #21: Josh Says:

    Ooops: I meant to refer to post # 11 here: http://www.1pixelout.net/2006/.....wordpress/

    Thanks,
    Josh

  22. #22: Christopher Says:

    Martin,
    Thank you for the great and simple Flash Mp3 Player.

    It was very simple to set-up.

    Now my English students can learn even better online.

    So far I’ve added it to a page explaining the pronunciation of regular verbs in the past.
    Having the pronunciation on the page lets them practice even outside of class!

    If one day I figure out how to record via the Internet I’ll have my students record themselves after listening :-)

    Here is a link to my first page to include sound:

    http://portallanguageservices......gverb.html

  23. #23: John Says:

    Mindy’s page/site is down.. anyway to post the tutorial on this site?

    thanks,

    John

  24. #24: John Edwards Says:

    Greetings Martin,

    Thank you for the amazing plugin. I use it religiously on my own site and recommend it to others as the best of it’s kind.

    One question I had was whether one might configure the player to be just a single Start button, without a slider or other details. I have someone who’d like to have their 30-second greeting in the upper right hand corner of their homepage start playing with just a single-button click.

    Thanks again,
    John

  25. #25: Martin Says:

    John: unfortunately, this is not possible without me modifying the player and I don’t have time to do this at the moment. Sorry…

  26. #26: John Kiernan Says:

    We have a website that lists a table with over 130 MP3 files. It *seems* in trying to use this (my friend has it on his website), that it chokes on the massive number of MP3s. We *think* it is trying to download 130 instances of the Flash player. Is this possible? We’re using Mindy’s technique for a non Wordpress site.

    TIA.

    – John Kiernan, OALAIG

  27. #27: Martin Says:

    John: it would help if I could see the page BUT anyway, my advice would be to reduce the number of players on the page. 130 instances on one page cannot be very useful for your users/visitors.

  28. #28: Mat Says:

    Hey, I got a problem with the 1 pixel out player.
    I don’t know where to place the line :

    In which HTML code ?

    Thanks…

  29. #29: Jerome Says:

    I keep getting this error on Firefox 2.0.0.6:

    ap_stopAll is not defined
    javascript:ap_stopAll(1)
    Line 1

    Most users don’t have problems listening to the audio but there are a few who cannot listen to the audio even if they’ve upgraded to latest Firefox and latest flash.

    When this error appears, the player just keeps on Buffering without playing, even if it has played fine previously. Any suggestion what should I do to avoid this problem? In order to be able to play again, I sometimes have to close the browser and then open the site again.

  30. #30: Martin Says:

    Jerome: this looks like you didn’t include the javascript file (audio-player.js). I can’t really give you more details without seeing an example.

  31. #31: Jerome Says:

    I added the following in my header template:

    and this fixed the error message. I think this should fix the Buffering issue. Thanks for pointing this out.

  32. #32: genevieve Says:

    hey, i was wondering if instead of using a web domain to host my own files, can i use some of the free online web hostings like zshare/fileden just to name a few?

    i would appreciate if you could reply directly to my email. if not, i’ll be refreshing this page constantly :)

  33. #33: Matthieu Says:

    Hello,

    I’m working on improving my website (www.gulivert.com) using Joomla.
    I’m trying to set the 1pixelout audio player with the tutorial but I didn’t manage in.
    The fact is that I don’t know which way to install it (if I’m in a blogger use or not for example).
    I’m using for my website a Joomlaschack Template, the “empire” one.
    I don’t know which HTML code shall I use (the long or the short from the tutorial) and where to place it in the code and in which code (the template HTML code ?).
    The player.swf and audio-player.js files are placed in my joomlasite/audio/ directory on my hard disk (I’m developping my website offline).
    One thing : I’m working on a macintosh MacBook ; is that a problem (I don’t think so) ?
    The thing is that on the preview of my site, the player appears and when I clic on “play” it gets longer but the signal “error opening file” appears.
    Shall I just set online my website to try to check it ?
    So please help me, I’m desperatly trying everything I can and it doesn’t work.
    Thanks for all,
    Best,

    Matthieu

  34. #34: Darrin Says:

    Is there a way to increase the buffer time so I can use a little higher bitrate for dial-up users?

  35. #35: Chris Says:

    Hi,

    I set up this great player on a website. But I have two problems :

    1. When it plays an mp3, it plays it twice with a decay. This is annoying as it prevents me from using it at all. What do you think is the problem and what ought to be done to fix it ?

    2. I would like to have a continuous music, even when the page is reloaded. I don’t think there is anywhere in the site structure where I could paste the code to make it possible.
    So, I thought I could try and play a free webradio instead (then it would probably just get on with the tune when the page is reloaded, not start it from the beginning again). Yet, I don’t know if it is possible, and if so, how to play a webradio with the audio player script. Could you help ?

    Thanks and keep on the good job !

    Chris

  36. #36: Martin Says:

    @chris: my guess is that there is a problem with your mp3 file. I can’t see why the player would play it twice. The easiest way for me to help is to see an example. Post a URL and I’ll have a look.

    As for the continuous play web radio thing, you won’t be able to achieve this with my player. Firstly, my player doesn’t support radio streams and secondly, the only way to achieve continuous play is to open a music player in a popup window (otherwise the player gets reset everytime you load a page).

  37. #37: Jerome Says:

    Hi Martin,

    Audio player does play radio stream. I used it here: http://www.dyrdam.com . Of course the language is not English but the Live Radio link is streamed. The streaming server is Icecast with LiveIce as the encoder.

    Of course, if the page is closed, the streaming stops. But if the page is reloaded, the player plays the real time stream. If it is stopped and played again, it will play the downloaded stream data from where it started the first time.

    jerome

  38. #38: hanafi Says:

    hi martin, when overlap with drop menu the player get on top and the drop menu behind..this happen because you dont put wmode transparent to it..but when I think back maybe it because you can customize color on the player..have you try to put flash properties wmode:tansparent and test it overlap with drop down menu suc as in my website here: http://www.alquran-melayu.com/1-al-fatihah/

  39. #39: hanafi Says:

    hi martin you can delete my post above. I didnt see the option of page-transparent in player setting-I already set that to transparent and it fixed the overlap issue, I think this option better be default because, if any color the page is, we should have turn on wmode transparent so the drop menu dont overlap and get behind the player.

  40. #40: fuchs Says:

    May I ask,
    does the player support m3u streaming or not?
    There’s a previous asking the same, but still no reply…
    thx,
    fuchs

  41. #41: Yannsen Says:

    Hi Martin,

    first let me thank you for this neat plugin! I’ve had one problem in customizing it, though. Basically it stays white/transparent all the time and ignores my bgcolor attribute.. Changing the bgcolor attribute at runtime wouldn’t work. Take a look at my recent blog entry and the code I used on Wordpress:

    [audio http:xxx.mp3|bgcolor=0xefefef|bg=0xefefef||slider=0xF14747]

    I’ve also tried to attach all three color attribute single, bgcolor is the only one that won’t work.

  42. #42: nicozab Says:

    SLOW CONNECTIONS?
    I’m using your audioplayer -great great job, btw- in a site here in latinamerica. Here, the ISPs and internet connections -even the so-called ‘high bandwidth’- are the worst. The player in slow connections begins to have hiccups and pauses.. how can we be over this? It’s possible to increase the buffering via a flash variable? any ideas?
    [thank you very much for any help, I really like your player and we want to use it..]

    another question: It’s possible to get a ‘mini’ version of the player? something more like one-line text height?

    thanks again.

  43. #43: Martin Says:

    @nicozab: you can’t change the buffering options via flashvars in the current version. I’m currently working on version 2 and will have a look at what I can do (shouldn’t be very complicated). As for the mini version, I can’t promise anything. I may look at it in the future but this would be quite a big feature to implement

  44. #44: Jack Bergstrom Says:

    Thanks Martin for your audio player plugin. I am using it on my Wordpress blog and I found it easy to configure and use. I gave you a brief mention on my blog entry for November 12th, 2007.

    Thanks again and wishing you the best!

    Jack Bergstrom
    Executive Coach and Consultant, Seminar Leader, Author
    http://www.jackbergstrom.com
    jack@jackbergstrom.com

  45. #45: Rich Says:

    Many thanks for this simple but elegant little player. I am going to incorporate it into my site but before I do, (as I have over 50 mp3’s to use it with) when do you think the new player will be ready? The volume control and TRUE pause are what I am most interested in. Users come to my site and play small bits of tracks to find what they like, so if they started a bunch of tracks with no true pause, they would all be loading and could bog down the connection. Also, the volume control is a must! :-)

    Please give us an idea of the release date for the new player. I might wait until its ready if it will be soon.

    MANY Thanks!
    R Hughes
    http://www.prydemultimedia.com

  46. #46: Martin Says:

    @Rich: Sorry but I can’t give you a release date. It’s getting close but it takes a lot of time to build good software and I don’t want to release something that is not ready. I also have a day job and a busy social life. I’m also moving to a new flat soon so that takes some organising… What I can tell you is that version 2 will fulfill both your requirements (volume control and true pause as you call it). Be patient and sorry for not being able to be more precise…

  47. #47: Eric Says:

    I might be doing something wrong. Does the text, name of the song, appear for you? For me on my site it doesnt. Is there a line of code I need to add in order to display the name of the song?

    Thanks much

    -Eric

  48. #48: Brian Wilt Says:

    Eric-
    The artist and song title are generated in the audio player from the ID3 tags of the mp3 file itself. Many times the same app that you use to create mp3s from wavs also allows you add the ID3 tags at the same time. If not, there are many freeware apps out there that support this function.
    Brian

  49. #49: Eric Says:

    Something else. It seems that the player doesnt show up on IE. I tried it at home and at work. It works great in Firefox though, and I have an old version of that.. Just wondering if anyone has a fix, or if I might be doing something wrong.

    thanks for the info above regarding ID3 tags.

    -Eric

  50. #50: Rich Says:

    Is there anyone who can give me a specific code example to remove the flash IE box? The annoying “Click to activate this control”. I have found some code but nothing seems to work properly and some that might are confusing. I might mess the flash embed code up. Please help!

    Take a look at my site. Click the “Beats | Tracks” link. I have multiple players and need to get rid of the IE warning box.

    Warm Regards.
    Rich

  51. #51: Rich Says:

    My site is… http://www.prydemultimedia.com

  52. #52: QBlue Says:

    Why do players do not support the WMA format, hope update function, support more audio formats! Thank you!

    My site :www.qblue.cn

  53. #53: Brian Wilt Says:

    Nice looking site and good music to boot, Rich.

    Már Örlygsson has a great solution to the “Click to activate” annoyance at http://mar.anomy.net/entry/2006/11/24/02.12.18/

    Some other browsers (some versions of Firefox, for example) display this same warning, too.

  54. #54: myst Says:

    i wrote a little tutorial to embed this player in windows live spaces post:

    it’s written in italian, but the code is self-explaining :)

  55. #55: joe Says:

    The player keeps buffering the song instead of paying it - any suggestions?
    Here it is - http://www.churchatandover.org/AUDIO/audio.html

  56. #56: Richard Hughes Says:

    Can’t wait until you release the new version of the Flash Audio player. Just sending some good energy your way. Thanks again for what you’ve created for us already!

    R. Hughes

  57. #57: Barry Says:

    Hi Martin. It works great! Thank you for writing this plugin.

    Question, I want to invoke a player on my client’s home page but don’t want the instance tied to a specific post. The audio clip is a general welcome tune that must always play on the home page.

    I tried:

    if(is_home()){
    $options = array(”autostart”=>”yes”, “loop”=>”yes”);
    $source = “freebird.mp3″;
    ap_getplayer($source, $options);
    }
    // this didn’t work.

    I also tried:

    if(is_home()){
    echo “[audio:haikuhitohome.mp3|autostart=yes|loop=yes]“;
    }
    // fail

    (I didn’t really expect that to work of course.)

    Anyway I got it to work by manually writing out the html inside that conditional.

    So is it possible to invoke the player with one neat little phrase if you don’t want to use standard method of calling it within the post?

  58. #58: PeePay Says:

    I haven’t read everything about the player, so I don’t know if I am not asking something what has already been mentioned before, so I’m sorry if it has.

    Many people want this player because it is just to listen and not to download audio files played by the player, but I want the opposite. Is it possible that there would be a download link to the audio file right in the flash player, while playing the file?
    Thanks

  59. #59: PeePay Says:

    Would it be possible to have a download link to audio file which is being played right in the flash player?

  60. #60: PeePay Says:

    Sorry for double comment, I wasn’t sure if the first one was sent, so I asked again.

  61. #61: Tony Lindskog Says:

    This is an excellent plugin and it works in Joomla.

    I do appreciate the auto-switching on/off when switching players.

  62. #62: Mogens Says:

    Hi there, Great mp3-player. Could you do a customized version (I need two added features - see below). I will be able to pay a (small) ammount for this.
    I need: Support for non-latin charachters in filename/path (iTunes issue). I have tried to use PHP/Urlencode - but it does not seem to work. Secondly I need the player to direct the browser to a different page as the mp3-files had done playing.

  63. #63: George Says:

    I ask how I can make the autorun on this code:

    because I’m using a html webpage not wordpress

  64. #64: George Says:

    I ask how I can make the autorun on this code:

    because I’m using a html webpage not wordpress

    Thanks a lot

  65. #65: Santi Says:

    Best player for me, great work! I knew it thru http://www.eslpod.com and love the interface.

    Anyway, is there any plan to add it support for M3U playlists? I would be able to help by coding the file format support

    Thanks in advance

  66. #66: Lubi Says:

    I have the same problem as mentioned in post #55: The player keeps buffering instead of playing the audio file. But the problem just appears in Firefox (2.0.0.13) - not in Internet Explorer…

    Has anyone an idea? ~:o\

  67. #67: jason Says:

    hi currently i am using wordpress and when i clicked on the OPTION - AUDIO-PLAYER, i am having this error
    can someone please guide me on this error ?

    Warning: include(audio-player/options-panel.php) [function.include]: failed to open stream: No such file or directory in /home/abc/domains/abc.com/public_html/wp-content/plugins/audio-player/audio-player.php on line 396

    Warning: include() [function.include]: Failed opening ‘audio-player/options-panel.php’ for inclusion (include_path=’.:’) in /home/abc/domains/abc.com/public_html/wp-content/plugins/audio-player/audio-player.php on line 396

    *www.abc.com is not my site, just as sample site replaced my original url site :D

    -if i am using the tricks just insert the coding

    <object type=”application/x-shockwave-flash” data=”http://www.fakedomain.com/myname/audio/player.swf”

    it is working fine but not by using the plugins for word press

    please advise…

    my email add

    jasonlimwk@gmail.com

  68. #68: mateo Says:

    Hi.
    Player is awesome.!
    Just one thought to share: I want people to preview tracks of an album, but I don’t want to give away the tracks urls!

    The fact that the path to the audio file is on the html code makes it easy for anyone (who knows how to check the source) how to get the audio file (mp3)…
    Is there any way to obscure the file?

    Thanks.

  69. #69: John Arroyo Says:

    great mp3 player! Only problem is when there are multiple on the screen opening one doesn’t close the previous player. With the example sites this worked, but for some reason it doesn’t work on my site, http://remixin.org/project.php

    I look at the code where and it worked and compared it to my site, bu I can’t seem to find the issue.

    thanks,
    -John

  70. #70: Brian Wilt Says:

    John -
    I think you have at least 2 problems:
    1) the path to the javascript file ()incorrectly contains “/myname” which should be removed;
    2) if I enter “http://www.remixin.org/audio-player/player.swf” directly into the address field of a browser and then click the (visually quite large version of the) player’s PLAY button, I SHOULD see the player with the message “Buffering…”. Instead, YOUR player’s message is “Error opening file…”.
    I would suggest deleting your current player.swf file from your web server and then uploading a fresh copy of it.
    Good luck,
    Brian

  71. #71: John Arroyo Says:

    You rock! That fixed it. Again, great flash player.

  72. #72: Brian Wilt Says:

    John-
    You’ve fixed players #1-#7, but players #8-#17 are still messed up. I think you’ll find that re-numbering all 17 objects’ in the same order as they appear on the page will fix this. Each player object from #8-#17 needs to have both ids re-numbered as per:
    id=”audioplayer#XX”
    AND
    value=”playerID=#XX.
    Brian

  73. #73: John Arroyo Says:

    Good catch! I have a function generating the players, it’s called 3 times so the numbers were reset to 1 each time. I have a persistent counter now so that the number go 1-17 without resetting.

  74. #74: Brian Wilt Says:

    You’re welcome.

  75. #75: jason Says:

    anyone can help me regarding the problem #67 ?
    thanks

  76. #76: Brian Wilt Says:

    Jason-
    Try using accurate, ADSOLUTE PATHS (example=http://domain.org/directory/directory/audio-player.js)
    for all of your files (player.swf, audio-player.js and the mp3s).

    Also, if you post the URL to the problem page here on this forum, then maybe someone will be able to look at the mark-up for you. I’m busy for the next couple days, but will check back later and see what, if anything, has happened.
    Brian

Leave a comment