Podcast entries have been ‘odeoized’
One final thing before I take off to Boston, I just wanted to mention that the podcasts on WSwI now have a flash player where you can play the audio files directly on the site. Granted this shouldn’t stop you from downloading them to your iPod to listen to them later, it’s just an alternative that allows you directly play them in a more convenient manner.
So, first thing’s first before I hear some of you cry “Now your webpage is not valid xhtml strict.” Well, I can live with that for now. I can no doubt use JavaScript to embed the markup into the page, but I’m too lazy for that right now.
Otherwise, I thought I’d share just a bit on how easy this was to integrate into Wordpress. If you haven’t noticed yet, Odeo is now offering (what I would like to call) “badge code.” What that means is that for every audio file that is picked up into your feed via Odeo, there is code provided for you that you can embed into your webpages.
Alright. Simple enough. What I did with that code is pasted it directly into my single.php file within your current theme directory and added a bit of logic to it. Oh right, and before I had even done that, I already had a particular category called “Podcasts.” That can be done simply by going into your wp-admin and clicking manage - > categories. Once that category has been added, it will have an id. Remember that id.
The next step is to open back up a podcast entry (a post) and add a custom “key/value” entry to that post. I called mine podcast_entry, then for the value I put the actual file name for the value (I didn’t bother putting the full path, but I could have).
Then finally, within my singe.php file I went ahead and put the following code in
odeo integration code for wordpress podcasters
<?php
// Wordpress Developers, pay special attention that this
// occurs within "THE LOOP"
if ( in_category(17) ): // 17 is my 'podcasts' category
$podcast_url = get_post_meta($post->ID,'podcast_entry',true);
?>
<!-- insert flash player if podcast -->
<object
classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
width="476"
height="80"
align="middle">
<param
name="allowScriptAccess"
value="any"
/>
<param
name="movie"
value="http://odeo.com/flash/audio_player_fullsize.swf?ver=1.03"
/>
<param
name="wmode"
value="transparent"
/>
<param
name="flashvars"
value="audio_id=999097&valid_sample_rate=true&external_url=http://www.dustindiaz.com/downloads/podcasts/<?php echo $podcast_url; ?>"
/>
<embed
src="http://odeo.com/flash/audio_player_fullsize.swf?ver=1.03"
width="476"
height="80"
allowScriptAccess="any"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
flashvars="audio_id=999097&valid_sample_rate=true&external_url=http://www.dustindiaz.com/downloads/podcasts/<?php echo $podcast_url; ?>"
wmode="transparent">
</embed>
</object>
<?php
endif;
?>
And with that, that’s all she wrote. It was that easy. I hope someone else finds this useful.













April 15th, 2006 at 10:35 pm
I can no doubt use JavaScript to embed the markup into the page, but I’m too lazy for that right now
so, hiding “invalid” code makes it valid? who cares if the code isn’t valid. does it work in all browsers? yep.
April 16th, 2006 at 7:24 am
When I have tu put flash content, I use the flashobject little library (http://blog.deconcept.com/flashobject/), which is very simple but very useful.
And when I have tu put simple audio content like a podcast, I now use Dewplayer, free for use (http://www.estvideo.com/dew/index/2005/12/03/603-dewplayer-reloaded , in french, sorry).
Maybe you could look at theese.
April 16th, 2006 at 7:37 am
Heh. I’m in Boston while I’m writing this.
Anyway, the flashobject.js was definitely on my list of using first. But like I said, I was lazy. The Dew Player I haven’t seen before, but I’ll have to check it out. I used odeo’s player because I feel that I owe them dues for being nice and I generally like the work that they’re doing over there.
April 17th, 2006 at 7:26 am
I’ll second the flashobject comment. I use it all the time and it actually makes embedding flash easier in my opinion. Hope you’re enjoyin’ it over here on the EASTSIDE!
August 18th, 2006 at 2:15 pm
Follow up:
I have some links to these and the ufo examples at this url:
http://www.wowtechminute.com/wow-tech-minute-transcript/activex-eolas-swfobject-ufo-alistapart.htm
aloha