YT-Audio: Audio Hosting From YouTube in WordPress

September 25, 2007 By: Erik R. Category: Geeky, Music, Wordpress 4,712 views

Rate this post:
1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading ... Loading ...

YT-AudioI’m a huge fan of the Audio Player plugin for Wordpress that lets you embed a flash player for a single MP3 file in a blog post. The problem is that you have to host the MP3 file yourself, and if your hosting service isn’t very generous with either storage space or bandwidth, it’s not a very good solution.

Most of the time that I want to attach a song to a blog post, it’s usually some pop song that I’m either listening to or my mood has reminded me of. Let’s face it, YouTube is the new MTV. Name a pop song, and the music video is probably on YouTube. I could embed the whole YouTube video of a song on my blog, but what if I just want the audio? What do I do then?

Introducing…. YT-Audio, the plugin for Wordpress to embed the audio from a YouTube video on your blog!yt-audio-streaming-audio-from-youtube.1.6.zip

How does it work?

It’s actually ridiculously simple. All it does is embed YouTube’s regular flash movie player inside two iframes that chop off all but the bottom control bar of the video. Nothing fancy. Just useful.

Instructions

You install it just like any other Wordpress plugin. Unzip it into the /wp-content/plugins, directory. Then, in your post, put the text:

ytaudio(2_HXUhShhmY)
Where "2_HXUhShhmY" is the code for the video on YouTube. And you should get something like:

It’s just that simple! I’ve tested this on Firefox, Safari and IE 7. It looks pretty good in all three. Enjoy!

Change History

1.6 2009-04-30 Oops. Remembered why volume control should be hidden. Sorry!
1.5 2009-04-30 Expanded iframe to include volume control.
1.4 2009-02-23 Fixed urls referencing plugins directory to work with the zip file available from wordpress.org.
1.2 2009-02-20 Fixed to accept YouTube codes with underscores and dashes.
1.1 2007-12-04 Modified to handle YouTube’s new flash player.
1.0 2007-09-25 Original version

41 Comments to “YT-Audio: Audio Hosting From YouTube in WordPress”


  1. This is an awesome plugin. Thanks. Is it possible to add a feature to it that would enable me to isolate excerpts from the audio? a start/stop switch in the ytaudio code?

    That’d be even more awesome!

  2. Sorry, 123, but, if that control of the YouTube flash player is even possible, I don’t know how to do it.

  3. Do you know of any good hosting service that will host audio files. I am referring to just the audio recorded all by itself, not as part of the video on YouTube.

    Who can host the audio file that I can use for posting on several blog sites, without uploading the file on each blog site?

    Any help will be greatly appreciated.

  4. Yes. Just the audio, without the video can be hosted at Apple iTunes as a podcast. Geoff.

  5. awesome, thanks!

  6. Daikil says:
    7

    A problem with de YT code with _ inside? Thanks

  7. Hello!

    I’ve tried to get your great plugin to work several times to no avail. Would you be able to take a look and see if there’s anything obvious that you can see?

    Thanks!

    Here’s the page:

    http://www.techherding.com/wp/2007/02/testing-plugin/

    I’ve downloaded the most recent version from your site, and also tried the version that comes us via Wordpress 2.7 auto-install.

    Thanks!

    Dick

  8. I’ve been looking for something like this for over a year now! Cool! But does it word with WordPress sidebar widgets? Is it widgetized?

  9. hi. Thanks for plugin

    perfect.

    Regards

  10. Genial! Gracias!

  11. it is not workin 2 me. dont know why. im using wp 2.7.1

  12. No, fruity, I don’t think it will work in a sidebar widget. It could probably be modified to, though.

  13. Dick, I’ve left a comment on that post. You don’t need the name of the parameter, just the value of the video code.

  14. Hello Erik (great spelling!), I am trying to install your plugin, when I insert the command, I actually only get a small window of the top left corner of my own blog? I wish i could send you a screenshot. I am trying to use this for a dedication today, would love any help or advice. Many thanks in advance,

    Erik

  15. Erik, I tried to email you at the address you gave, but the email bounced back. You can email me a screenshot to erikwordpressplugins -at- gmail.

  16. Thanks for the quick reply, Erik! I sent an email with the screenshots–also have a request into my server people about the bounce back, so I included an alternative email in this request. Cheers for your help!

  17. Hello Erik,

    Sorry for this flurry of emails and requests for help, I am including an alternate contact from my blog. I have sent the screen shots from both addresses just in case there is an issue, hope you receive those in good order. Thanks again fro any advice,

    Erik

  18. Is there a way to enable a “auto play/start” function so the music just starts playing?

  19. Chris, that’s an interesting idea. I was unaware that you could make an embedded YouTube video autoplay, but a quick google search showed me how. I might incorporate such a feature into YT-Audio soon.

  20. What a perfect plugin!
    Thanks

  21. Hi Chris,

    If you like to have the autoplay function, edit the frame.php file and look for the following line:-

    src=”http://www.youtube.com/v/”>

    and add “&autoplay=1″ just before the closing hyphen like below

    src=”http://www.youtube.com/v/&autoplay=1″>

    It works well for me.

  22. thanks Erik,

    this plugin is awesome.

  23. Hi,

    Just wanted to thank you for this incredbile plugin. I have yet to install it, but it is going to save me a bunch of time!

    Great timer about your baby as well. =)

    Cheers,
    Brian

  24. Hi Erik
    wow what a great plugin- I’ve spent the last 2 days trying to get wp audio plugin to work- it won’t. Then I found another audio plugin- but my files were too big to upload- now yours- brilliant.
    My question- is there a way just to add audio that is hosted on youtube? I have some audio files that I want to add to my blog but they are too large to upload apparently- any suggestions?

    Thank you
    Elaine

  25. Elaine, YouTube doesn’t host “just audio”. You’ll have to make a video with your audio as a soundtrack (it can be blank except for the audio) and upload that to YouTube, and use it with YT-Audio. Hope that helps.

  26. thanks for the plugin bro…simple and genius

  27. musicalnote says:
    28

    i have wordpress it doesnt work for me = (

    idk if i’m doin something wrong

  28. It would be cool to have a smaller version of the player. LIke half the size.

  29. Hi, I am wondering why the volume button is hidden? Isn’t it annoying if you ‘don’t have control over this function?

    regards,
    John

    • Yes, that is annoying. There’s a good reason, though. The reason is that the way the volume controls work in YouTube is that it pops up a vertical slider, and this slider is hidden inside the iframe just like the video is. Unfortunately there’s no way around this.

      I forgot about this when I published version 1.5, but it immediately became obvious why the volume button is useless, so I hid it again in version 1.6.

  30. great stuff! that’s just what i was searching for. keep up the good work

  31. Wicked plugin – but a quick question – I can get it playing individual songs but have tried to get it to play an entire playlist – am i missing something or is there an easy tweak to be done in order to include a playlist?

    for example, i’d like to turn this test playlist into an audio player…

    http://www.youtube.com/view_play_list?p=706409C9F41DE9A6

    thoughts?

    cheers!
    dale

    • As far as I know, you cannot embed playlists. I just made one and tried to embed it, and it didn’t move to the next video. They seem to only work if you’re on youtube.com.

  32. Kenold Beauplan says:
    36

    I’v been looking for this forever – thank you

  33. Hi, Erik,

    This plug-in is something I’ve been looking for! I’ve got one question. Would it be possible to use the plug-in in the footer? If possible, how? I’d like to know a php line as I’m not familiar with php at all…

    Thank you for your advice!

    • That’s a good idea, Otto. I hope to get to adding this feature by next week. Stay tuned here.

      • Thank you for your response! I’ll look forward to it.

        By the way, I’ve found a little problem with IE 7 (windows). While the YouTube player looks pretty good on FireFox, Chrome, Safari (all Mac), it looks little bit “off” with IE 7. I’m not sure whether you see what I saw, but top gray line disappears and also left gray line looks thicker and darker on IE 7. Yes, this is very very minor appearance matter, and nothing to do with the functionality, but would it be any tweak to fix this?

        Thank you. :)

  34. Really makes me wish I was wordpress and not blogger. Any idea if it can be used on a blogspot blog as well? Any way at all?



Leave a Reply