I’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!
Frequently Asked Questions
- The player shows up, but the song won’t play. What’s up?
- This will happen if embedding has been disabled for the video you are using. Because the video portion of the player is hidden, so is the message telling you that embedding is disabled. Try to embed the entire video with the full embed code from YouTube before reporting a problem.
- Where is the volume control?
- When the volume control opens in the YouTube player, it opens over the video portion of the player, which is hidden inside a frame by this plugin, so even if YT-Audio displayed the volume control button, you could not change the volume with it because the popup slider would be hidden. This is unfortunate, but there’s nothing that can be done about it.
- I’m getting something in the frame that looks like my blog header. What’s wrong?
- This will happen if your plugins directory is not in the default location. You will need to edit the two lines in `ytaudio.php` that contain `wp-content/plugins/yt-audio-streaming-audio-from-youtube` to reflect the actual location of the ytaudio plugin with respect to your blog root.
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 |

(3 votes, average: 4.67 out of 5)
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!
Sorry, 123, but, if that control of the YouTube flash player is even possible, I don’t know how to do it.
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.
Yes. Just the audio, without the video can be hosted at Apple iTunes as a podcast. Geoff.
awesome, thanks!
thanks.
A problem with de YT code with _ inside? Thanks
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
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?
hi. Thanks for plugin
perfect.
Regards
Genial! Gracias!
it is not workin 2 me. dont know why. im using wp 2.7.1
No, fruity, I don’t think it will work in a sidebar widget. It could probably be modified to, though.
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.
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
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.
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!
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
Is there a way to enable a “auto play/start” function so the music just starts playing?
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.
What a perfect plugin!
Thanks
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.
thanks Erik,
this plugin is awesome.
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
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
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.
thanks for the plugin bro…simple and genius
i have wordpress it doesnt work for me = (
idk if i’m doin something wrong
I need more information if you want help. Paste in the code you are putting into your post?
It would be cool to have a smaller version of the player. LIke half the size.
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.
great stuff! that’s just what i was searching for. keep up the good work
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.
Eric,
Ah, but you can embed Playlists, but you have to create a Custom Player from that Playlist first, then embed the Custom Player.
There used to be a link on the Account page. I don’t see a link, anywhere, but if you’re signed in, this link will get you there:
http://www.youtube.com/my_players
And here’s an example of an embedded Playlist, in a Custom Player:
http://www.savekutaustin.com/?page_id=1314
gary
Eric,
And looks what you get if you strip the Custom Player URL out of the embed code (try resizing the window. The video player size changes simultaneously. Nice:
http://www.youtube.com/cp/vjVQa1PpcFP1vJwe9exnUYIG0WMEG1Bk6V17q_AqUvU=
I’v been looking for this forever – thank you
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.
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?
Sorry, I don’t know enough about the inner workings of Blogger. You’d need to be able to upload your own PHP file.
For some reason this wont work
ytaudio(mUT3KoxVzQg)
http://www.youtube.com/watch?v=mUT3KoxVzQg&feature=related
Any suggestions?
Also is there a way to have it automatically play when you view the post?
Great plugin. The only issue is you can’t use the volume control. Is there any way to fix this?
Good question, Johnny, and one that is frequently asked. So I have added a FAQ section of the post above to answer it.