Podcasting

So far, you’ve seen how to let viewers play individual audio tracks or a playlist with
a bunch of music on it. Podcasting is a similar, but slightly different, way to present
audio. It gives readers the choice of listening to audio files the normal way (in their
browsers by clicking the Play button) or downloading the audio files so they can
put them on a mobile device.
The central idea with podcasting is that you prepare content that busy people will
listen to on the go. Usually, the content is long—30 minutes to an hour is common
for podcasts. If your audio file is only a couple of minutes long, it’s not worth a visitor’s
trouble to download it and transfer it to a mobile device.
Podcast creators also tend to organize podcasts in groups—for example, they make
each audio file an episode in a series, and release them at regular intervals (say,
weekly). Good examples of podcasts include a web talk show with commentary
and interviews, a motivational lecture, a spoken chapter from an audio book, or a
45-minute techno mix for a workout session.

NOTE The word podcasting is a mash-up of pod and broadcast—pod because this form of audio file distribution
first gained popularity with the iPod music player, and broadcasting because a podcast creator provides
easily accessible, regularly released audio “shows,” a concept that’s a bit like television broadcasting.

CREATING PODCAST-FRIENDLY AUDIO

You don’t need any special technique to upload a podcast audio file. You can simply
create a post and add an ordinary link to the file. If you want to get a bit fancier, you
can use the audio player feature described on page 360. That way, visitors can play
the audio in their browsers if they haven’t caught the podcast bug.

You should save podcast audio as MP3 files, because a range of mobile devices can
play back that format. You can also create podcast video files, but that process is a
bit more complicated. You first need to make sure the video is in MP4 format, then
you have to upload it to a host, and finally you need to link to it from your post.
NOTE If you want to use a video file for podcasting and embed it so guests can play it directly inside their
browsers, you need the help of a high-caliber podcasting plug-in, as explained in the box on page 368.

GETTING YOUR PODCAST FEED

Although podcast audio is the same as normal audio, there’s a slight difference
in the way you present podcasts. For readers to find your podcasts quickly and
download new episodes easily, you need a way to separate these audio files from
the rest of your site.
To do that, you create a dedicated category for posts that contain podcasts. You
can give this category a name like “Podcasts” or “Lectures” or “Audio Book.” Then,
when you create a new post that has an audio file in it and you want to include
that audio as part of your podcast, assign the post your podcast-specific category
(Figure 10-23). Depending on the structure of your site (and the way you let viewers
browse it), you may decide to set two categories—one to identify the type of post
(say, “Sports”), and one to flag the post as a podcast (“Podcasts”).

You group audio files into a single podcast category so you can generate a feed for
that category. As you’ll learn on page 433, a feed is a sort of index to your content.
In the case of podcasting, your feed tells other programs and websites where to
get the podcast files on your site. It also lets you notify visitors when you publish a
new file—say, if they subscribe to your podcast in iTunes.
NOTE iTunes is one of the favorite tools for podcast-lovers. If your site offers podcasts and you’d like to use
them to attract new visitors (and why wouldn’t you?), you need to submit some podcast information to iTunes.
You can get the feed for a category using a URL with this syntax:
http://[Site]/category/[CategoryName]/feed
So if you have a site named http://dimagiosworkouts.com, you can get a feed for
the Podcasts category like this:
http://dimagiosworkouts.com/category/podcasts/feed
This is a valuable link—it’s the piece of information you need to supply to iTunes to
register your podcast.

To register with iTunes, start by reviewing Apple’s instructions at http://tinyurl.com/
podcastspecs. First, read the “Testing Your Feed” section, which explains how to
make sure your feed includes the podcast files you expect, and that the feed works.
Then, follow up with the instructions in the “Submitting Your Podcast to the iTunes
Store” section to learn how to officially tell iTunes about your feed, and make it visible
to a podcast-hungry audience of millions.

PLUG-IN POWER

Better Podcasting with a Plug-In

Podcasting with WordPress is easy. All you need is the right
type of audio file (MP3) and a post category just for podcasts.
However, if you’re a power podcaster—meaning you plan to
invest serious effort in making podcasting a part of your web
presence—it’s worth considering a plug-in that can make
your life easier. The most popular podcasting plug-in for selfhosted
WordPress sites is Blubrry PowerPress (http://tinyurl.
com/wp-podcast).
Among PowerPress’s most useful features is its tight integration
with iTunes. PowerPress can optimize your feeds for iTunes,
submit your feed to iTunes, and even help you manage your
iTunes cover art. PowerPress is also invaluable if you want to
forge into the world of video podcasting, because it lets you
embed your video content in your page, using a JavaScriptbased
video player. (That way, visitors have the choice of
downloading your podcast for a mobile device, as usual, or
playing it right in their browser, as they would with a YouTube
video.) PowerPress also offers statistics that help you gauge
the popularity of your podcasts and an optional paid hosting
plan for audio and video files.

Advertisements
Podcasting

Using a Music-Sharing Service

If you’re serious about sharing a set of audio tracks—for example, you’re a band
trying to popularize your work—your best bet is to sign up with a serious musicsharing
service.
The first advantage is that a good music service increases the exposure of your audio
tracks. Casual music browsers may stumble across your work, similar artists may
link to it, and just about anyone can add a comment or click Like, which boosts your
buzz. The second advantage is that you get a number of extras, like the ability to
provide music in different formats for different browsers (without resorting to Flash),
and a sleek jukebox-style player that seamlessly plays a whole set of your songs.

WordPress has built-in support for the following music-sharing services through its
auto-embed feature:
• SoundCloud
• Spotify
• Rdio
If you have a WordPress.com site or a self-hosted site with the Jetpack plug-in, you
get two extra services courtesy of shortcodes:
• [bandcamp: shortcode must include 'track', 'album', or 'video' param] for audio on Bandcamp
• for audio on 8tracks
Once again, the shortcode syntax varies subtly for each service, so you need to get
the exact details at http://support.wordpress.com/shortcodes.

To embed your SoundCloud content in a WordPress post, browse to the song or
playlist you want to use, and then copy the URL out of the address bar. Here’s the
URL that creates the music player in Figure 10-22:
https://soundcloud.com/andrewgorny/sets/ag-com-splash
If you want to adjust the size of the SoundCloud player, use the shortcode
with the height and width attributes.

Using a Music-Sharing Service

Playing Audio Files

Sometimes, you’ll want to let readers play an audio clip (or several) without using a
full-blown video window. An obvious example is if you’re a music artist promoting
your work. However, audio files are equally well suited to the spoken word, whether
that’s an interview, talk show, sermon, audio book, or motivational lecture. Audio
files are particularly useful if you want to join the Web’s thriving community of
podcasters—sites that provide downloadable, long audio files that users can listen
to on the go (for example, on their iPods or smartphones).
You might expect that adding audio to your WordPress site is easier than adding
video. After all, audio files are smaller and simpler than video files. But you’ll face
many of the same issues. In the following sections, you’ll consider three strategies
for getting audio into a web page.

Adding a Basic Audio Player

The simplest approach to hosting audio is to upload the file to your website. You
can then provide a link that readers can use to download the file or (even better)
a tiny audio player that lets them listen without leaving your site (Figure 10-20).
Before you get started, you need to upload your audio file. Ideally, you’ll upload
an MP3 file to ensure that it plays on most browsers. Technically, Internet Explorer,
Safari, and Google Chrome play MP3 files, but Firefox and Opera don’t. However,
most websites get by using the Flash player to fill the gap. Essentially, the process
works like this:
• If the browser you use recognizes both MP3 files and HTML5 markup, WordPress
creates an HTML5 <audio> element that points to your MP3 file. The browser
then creates a miniature audio player, like the ones shown in Figure 10-20.
• If a browser doesn’t play these two standard file types, WordPress uses a small
Flash program that creates a tiny audio player. The end result is the same—your
guests see a simple music player.
• In the unlikely event that a browser can’t meet either of these requirements,
WordPress swaps in an ordinary HTML link. Guests click the link to download
the audio file, where they can play it using a desktop music player.
The Flash fallback solution is a good one, but it’s a bit too messy to implement
on your own. Fortunately, WordPress does all the work for you with the
shortcode, which is every bit as straightforward as it should be. You simply add an
attribute named src that points to your audio file. Here’s an example that launches
an MP3 file on another web server:

You can also use the shortcode to play music files stored on your own website.
But before you go any further, there’s a significant catch that applies if WordPress.com
hosts your site. Unless you buy a space upgrade or have a Premium account (page
359), WordPress.com won’t let you upload any audio files, even if you have plenty of
space left in your initial 3 GB storage allotment. Instead, you can play only audio files
stored on other sites.

Depending on what you’re trying to accomplish, this limit might be a minor inconvenience
or completely unworkable. If it’s the latter, you have two options. You can buy
a space upgrade for as little as $20 a year (click the Store menu in the dashboard to
sign up), or you can use a music hosting service.

To play an audio file directly from your site, you need to upload it to the media library
and then embed it with the shortcode.

Adding a Playlist

You can use the shortcode to add as many audio playback bars as you want.
Figure 10-20, for instance, has three. But if you want to give your visitor the chance
to peruse a group of related tracks—like a concert of songs performed by your trombone
quartet—there’s a better way. You can group your tracks together in a playlist.
A playlist is a list of audio or video files with a single playback bar or video window
(see Figure 10-21). Your visitor can click a specific track to play it, or let the playlist
move automatically from one file to the next.
Here’s how to add an audio playlist (see the Note below for video playlists):
1. Click Add Media.
2. Drag your audio files onto the Insert Media window,
3. Once you’ve uploaded all your files, click Create Audio Playlist on the left.
4. Click each track you want to use in your playlist, and fill in its details on
the right.
5. Click the “Create a new playlist” button.
6. Configure your playlist.
7. Click “Insert audio playlist.”
8. Publish your post.

NOTE You can create a vdeo playlist in much the same way as an audio playlist. The difference is that you
upload video files instead of audio files, and you click a link named Create Video Playlist instead of Create Audio
Playlist. The finished result is a bit different, too—it looks like a standard video window with a playlist attached
underneath.

Playing Audio Files

Showing a Video from Your Media Library

Although a free video-hosting service meets most people’s needs most of the time,
self-hosted WordPress sites can host their own videos. The basic approach is pure
simplicity:
1. Click Add Media above the post editor.
This opens the familiar Insert Media window, which you used to add pictures
and picture galleries earlier.
2. Drag your video file onto the Insert Media page.
Not any format will work. And, confusingly enough, there are more video formats
than Ben & Jerry’s ice cream flavors. For best results, you should use a
video file encoded with the high-quality, wildly popular H.264 video codec, and
stored in the MP4 container format. If your file has the extension .mp4, you’re
off to a good start.
TIP If you don’t have an MP4 video file on hand, think carefully before you continue. If you upload a different
video format, your video player may not work on certain browsers, on mobile devices, or on anything, actually. To
straighten out the format of your video files, consider a good video converter like the free Miro Video Converter
(downloadable from http://www.mirovideoconverter.com), which can convert almost anything to MP4 format.
Depending on the size of your video, you may have a bit of a wait. Grab a cup
of coffee.
3. In the “Embed or Link” setting (on the right), pick Embed Media Player.
Your other option is to add an ordinary link that points to the media file.
4. Click “Insert into post.”
WordPress slots your video in using the shortcode.
At the end of this process, expect to see something like this:

Here, the shortcode specifies the size of the video window (based on the
dimensions of your video file) and identifies the video file stored on your site. When
you publish your post, the shortcode creates a video window similar to the one you
got with YouTube.
Although the process seems easy, plenty of caveats apply. First, it’s up to you to
make sure that you have the not-inconsiderable space to store the video file, and
the monthly bandwidth to show it to all of your viewers.
It’s also up to you to make sure you use a video file format that most browsers can
play back. The previous example uses the most popular standard: an .mp4 video
Chapter 10: Adding Picture Galleries, Video, and Music 357
EMBEDDING A
VIDEO
file. Most browsers can play it, but there are plenty of exceptions, including the
Opera browser and old versions of Internet Explorer. Fortunately, WordPress relies
on the nearly miraculous powers of a JavaScript tool called MediaElement.js (http://

mediaelementjs.com). It rounds out most browser issues by intelligently switching to
other players, like Flash or Silverlight, when a browser can’t play the file you supply.
Thanks to MediaElement.js, the shortcode shown above works reliably on
almost as many computers as the YouTube shortcode (although it won’t work so
nicely on mobile devices, because there’s no slimmed-down, low-bandwidth mobile
version, like the sort that YouTube creates).
You have another option, but it’s impractical unless you’re ready to sacrifice your
social life and spend hours of extra video-encoding time. Obsessive web developers
can resolve format issues by providing fallback video files—multiple copies of the
same movie in different formats. You can then specify a range of formats that the
shortcode can use. Here’s an example that supplies a standard MP4 video
but adds fallback videos for the free WebM codec and for the Flash (.flv) player:

If you find yourself in the difficult position of running into the limitations of YouTube,
but not wanting to face the headaches of do-it-yourself video hosting with the
shortcode, there’s one more option. You can sign up with another video hosting
service—one that may not be free, but will provide more features and control than
YouTube does. The next section has the details.

Showing a Video from Your Media Library

Showing Videos from Other Video Services

Although YouTube is the most popular video service, it’s not the only game in town.
Happily, WordPress’s auto-embed feature lets you play video from a range of other
media sites, including:

• Hulu
• Dailymotion
• Vimeo
• Viddler
• blip.tv
• Funny or Die
• Qik
• Flickr (for videos as well as pictures)
• Revision3
• WordPress.tv
As with YouTube, you simply supply a web address that points to a video on one of
these sites, and WordPress does the rest.
Additionally, if you use WordPress.com or you installed Jetpack, you can use the
following shortcodes to embed even more types of video:
• [cnnmoney-video] for videos from CNNMoney
• for videos from Kickstarter
for TED Talks videos
for videos from Twitch.tv
for videos from Ustream.TV
• for a Vine video
• [videolog] for videos from Videolog.tv
for a video from The Internet Archive
The list of eligible sites is ever-growing, so don’t be surprised to find additional
services listed when you check WordPress’s official list of auto-embeds (http://

codex.wordpress.org/Embeds) and shortcodes (http://support.wordpress.com/
shortcodes).
When you embed video, WordPress configures the size of the playback window to
suit the content and to fit in your post area. However, in some situations, you might
want to tweak the size to get it just right. If you use one of the video types from the
first list, you can control the size of the video player by wrapping your URL in the
shortcode and then adding the height and width attributes. If you use one of
the more specialized shortcodes in the second list, you probably need to add similar
height and width attributes to that shortcode. Here’s where things get a bit tricky,
because many shortcodes have similar but maddeningly different syntax. To see
exactly how to format a specific shortcode, check out the WordPress documentation
at http://support.wordpress.com/shortcodes, and click the Full Instructions link next
to the shortcode you plan to use.

Showing Videos from Other Video Services

Configuring the YouTube Video Window

If the embedded window looks the way you want it to, there’s no need to do anything
else. But if you want to tweak its size, you can.
The easiest way to do that is by using the height and width attributes of the
This straightforward approach doesn’t always work. Certain themes and plug-ins
accidentally disrupt the sizing process, leaving you with full-sized YouTube videos.
To narrow down the cause of the problem, try disabling all your plug-ins one by
one, and then re-enabling them individually until you find the misbehaving plug-in.
If that doesn’t help, you can also try previewing your post with a different theme.
NOTE The shape of the video window depends on the video itself. YouTube won’t stretch a video out of its
normal proportions. For that reason, you should probably specify just the width or height of your video, but not
both. If you do use both, your video window will get the dimensions you specify, but YouTube will pad the video
with blank space to avoid stretching it.
Once you switch to the
You can also set where playback should start and where it should end by adding
&start and &end to the URL, along with a number of seconds. For example, this video
player hides related videos, starts playback at the 1-minute mark (when the viewer
presses the Play button), and pauses it at the 2-minute mark:

Finally, it’s worth noting that you can do the same thing using a slightly different
syntax with the shortcode:

Configuring the YouTube Video Window

Embedding a Video

Now that you’ve jazzed up your site with pictures, it’s time for something even more
ambitious: video.
There are two reasons you might put a video playback window in a post (or page).
First, you may want to use someone else’s video to add a little something extra to
your content (which is the ordinary text in your post). For example, if you comment
on a local protest concert, your post will be more interesting if you include a clip of
the event. Similarly, if you review a new movie, you might include its trailer. If you
talk about a trip to Egypt, you might want to take visitors inside the pyramids. In all
these examples, the video adds a bit of context to your post.
The other possibility is that the video may actually be your content. For example, you
might use video to show your band’s latest live performance, a bike-repair tutorial
you filmed in your garage, or a blistering web rant about the ever-dwindling size of
a Pringles can. In all these cases, you create the video and then use your WordPress
site to share it with a larger audience.

TIP Depending on the type of site you create, your written content doesn’t need to be about the video—instead,
the video could add supplementary information or a bit of visual distraction. For example, you may talk
about your favorite coffee blend and add a video that shows the grueling coffee harvest in Indonesia. Used carefully
and sparingly, video accompaniment can enhance your posts in the same way a whimsical picture cribbed
from a free photo service can.
To present someone else’s video on your site, find the movie on a video-sharing site
and copy the address. Most of the time, that video-sharing site will be YouTube, the
wildly popular hub that rarely drops out of the top three world’s most visited websites.
And if you want to show your own videos, you’ll probably still turn to a video-hosting
service like YouTube because the alternative—uploading your video files straight to
your web server—has some significant drawbacks. Here are some of the reasons
you should strongly consider a video-hosting service:

• Bandwidth. Video files are large—vastly bigger than any other sort of content
you can put on a site, even truckloads of pictures. And although you probably
have room for your video files on your web server, you might not have the bandwidth
allotment you need to play back the videos for all your visitors, especially
if your website picks up some buzz and has a hot month. The result could be
extra charges or even a crashed website that refuses to respond to anyone.

NOTE
Bandwidth allotment refers to how much web traffic your site host allows. Hosts may limit bandwidth
so that an extremely busy site—one with lots of visitors stopping by or downloading files—doesn’t affect the
performance of other sites the service hosts.

• Encoding. Usually, the kind of file you create when you record a video differs
from the kind you need when you want to share it online. When recording, you
need a high-quality format that stands up well to editing. But when viewing a
video over the Web, you need a heavily compressed, streamlined format that
ensures smooth, stutter-free playback. Sadly, the process of converting your
video files to a web-friendly format is time-consuming, and it often requires
some technical knowledge.

• Compatibility. In today’s world, there’s no single web-friendly video format that
accommodates the variety of web browsers, devices (computers, tablets, and
mobile phones), and web connections (fast and slow) out there. Video services
like YouTube solve this problem by encoding the same video file multiple times,
so that there’s a version that works well for everyone. You can do the same on
your own, but without a pricey professional tool, you’re in for hours of tedium.
For all these reasons, it rarely makes sense to go it alone with video files, even if
you produce them yourself. Instead, pick a good video service and park your files
there. In the following section, you’ll start with YouTube.

The Dangers of Using Other People’s Video

The risk of embedding other people’s videos is that the video
hosting service may take the videos down, often because of
copyright issues, and they’ll disappear from your site, too. This
is a particularly acute danger for videos that include content
owned by someone other than the uploader. Examples include
scenes from television shows and fan-made music videos.
Usually, WordPress authors don’t worry about this problem—if
a video goes dead, they edit their posts after the fact. To avoid
potential problems from the get-go, stay away from clips that
are obviously cribbed from someone else’s content, especially
if they’re recent. For example, a video that shows a segment
from last night’s Saturday Night Live broadcast is clearly at
risk of being taken down. A decades-old bootleg recording of
a Grateful Dead concert is probably safe.

Showing a YouTube Video

Hosting a YouTube video in WordPress is ridiculously easy. All you need is the video’s
web address.
To get it, start by visiting the video page on YouTube. (If you’re one of the six people
who haven’t yet visited YouTube, start at http://www.youtube.com.) If you haven’t already
found the video you want, you can spend some time searching around.
When you find the right video, click the Share link under the video window. A panel
of information pops open, including a text box with the URL you need (Figure 10-17).
The URL will look something like this:
http://youtu.be/OxKKr0Qrcjg

The first part, youtu.be, is a more compact form of the video’s full web address
(which starts with http://www.youtube.com/watch?v=). The string of letters and numbers
after it uniquely identifies the video you want.

The next step is even easier. Paste the video URL into your WordPress post, on a
separate line, in the location where you want the video to appear,

Now publish your post. You’ll be rewarded with another transformation, courtesy of
WordPress’s auto-embed feature. This time the URL turns into an embedded video
window.

Uploading Your Videos to YouTube
The process of playing your own videos through YouTube
is essentially the same as the one for showcasing someone
else’s. The only difference is that you begin by signing up
with YouTube (if you don’t already have an account) and then
uploading your video. The steps are fairly straightforward—
click the Upload link at the top of the home page, next to the
YouTube search box, and then follow the instructions YouTube
gives you. Make sure you designate your video as public, which
means that it appears in YouTube’s search results. If you don’t
use this setting, you won’t be able to embed your video in a
WordPress post. Other settings (for example, whether you
allow comments and ratings) have no effect on whether you
can embed the video.
For best results, YouTube recommends that you upload the
highest quality video file you have, even if that file is ridiculously
big. YouTube will encode it in a more compressed,
web-friendly format, while preserving as much of the quality
as possible. And if the quality of your video is good enough,
YouTube will offer high-speed viewers the option to watch it
in high-definition format, using the H.264 standard.
Uploading videos takes a while, because the files are huge
and transferring all that data takes time, even on the fastest
network connection. YouTube also needs to process your video,
although its industrial-strength servers can do most of that as
you upload it. When you get the video live on YouTube, click
Share to get the URL you need for your WordPress post, which
you can paste alongside your content, exactly as you did before.

Embedding a Video