WordPress video embeds
January 13th, 2009
I’ve been noticing lately that embedded video wasn’t showing up in my feeds in Google Reader. The video displays on the blog itself, it’s in the RSS, and Feedburner displays it in their feed preview. But Reader ignores it. And then I remembered that this problem started when I upgraded to WordPress 2.7.
After a little investigating I found that it seems to be a problem that was introduced (possibly reintroduced—WordPress has had this problem before) with the 2.7 version of the WYSIWYG editor component. I opened Trac ticket # 8850 for the bug.
The workaround is to always edit your posts using the HTML editor instead of the Visual editor when you’re embedding anything with <object> and/or <embed> tags like YouTube videos. That applies even if you come back to the post later to make an edit. Just switching to the Visual editor mangles the code.
Update: I don’t think the bug is going anywhere. :-) The problem is being caused by the TinyMCE media plugin. What appears to be happening is that it’s converting the <object>….<embed>…</object> tags into an image for pretty display in the visual editor. Then it uses its own flash embed template to convert that back into HTML again… without the <embed>.
Another solution, if you ever want to use the visual editor, is install a plugin that allows you to embed videos using syntax akin to WordPress.com’s shortcodes. WordPress.com allows you to type youtube=url inside square brackets and then it (surprise!) does it the way YouTube recommends, <embed> tag and all. But to get that to work with a custom WordPress install you need a plugin. Search WordPress.org for YouTube plugin and you’ll find a few to choose from.