Workaround for Poor Embedded Video Support in Email Clients

WordPress has a neat feature that allows you to easily embed content from video sharing sites such as YouTube by simply writing the URL of the video you want to embed in your post, like this:

http://www.youtube.com/watch?v=RJM4697kLL4

When your post is displayed, this gets replaced with an iframe which contains the content you wanted to embed, like this:

This works great in a web browser, but isn't so good in your MailPress newsletter, because most email clients don't support iframes. Your readers end up with a newsletter with a blank space instead of the embedded video content. Andre has done some experiments to address this, but nothing has seen the light of day yet. The problem isn't really MailPress's fault, but it does make newsletters with postings containing embedded videos look pretty odd at present.

As a workaround, I suggest disabling the automatic embedding so that the email reader at least sees the link to the video instead of a blank space. To do this, add the following line to the top section of your MailPress theme's _loop.php where you disable content filter plugins that aren't compatible with MailPress:

remove_filter('the_content', array(&$GLOBALS['wp_embed'], 'autoembed'), 8 );/* Dont process autoembeds */

That will stop the link turning into an invisible iframe in the email. In order to make the link clickable, you also need to install the Auto-hyperlink URLs plugin. This will make all plain text URLs in your content clickable on your website, not just in MailPress newsletters; but that's probably not a bad thing. I suggest changing the Auto-hyperlinks default settings to avoid stripping the protocol so the link looks the way it did in your editor.

Liked this post? Subscribe to get more like it via email.

About Graham

I'm the creator of BuildYourBlog.net.
This entry was posted in MailPress and tagged , . Bookmark the permalink.

4 Responses to Workaround for Poor Embedded Video Support in Email Clients

  1. Jack says:

    Regarding iframes, I recently had a major problem with a premium wp theme that I bought. Had to tweak it real hard to get it to display iframes embeds in the homepage (in posts, it was displaying). Seems iframes isn't really 100% implemented and supported all around, even though YouTube embeds are iframes.
    WP and theme creators should really look more into the problem because if you do a search on wordpress and iframes, you will find only posts on forums and blogs on rants about it.
    I don't think there is a blog out there without having at least 1 YouTube embed. And to be honest, the new thing where wordpress detects YouTube links and auto-embeds them, does not appeal me at all. I want to embed YouTube links on the width and height that I want.

    • Graham says:

      The WordPress Video Plugin allows you to specify a width and height for YouTube embeds, but the workaround I mention in this post won't work so videos embedded this way won't appear in your MailPress newsletter. Cheers, Graham

  2. Jim Jenks says:

    Thanks for this. It helps as I will be including video embedding here pretty soon. Also, I would recommend getting rid of the popup that makes me wait 30 seconds if I don't Tweet or Share. Not a good way to keep your CTR up .

  3. Valerie says:

    This was great information. I haven't run into the video embed problem yet (I don't embed many videos!), but I'd not really paid much attention to the MailPress content filters, so it's good information to file away. I've more recently had a few problems with other plugins not being compatible with MP (rotating images, and such), so haven't used it as much. I miss the functionality of it though. What I could do with just MP, takes at least 2 other plugins.

    BTW, this page took over half a minute to load, then your popup asking me to share added another almost 20 seconds. As a general rule, I'd just leave rather than wait.

Comments are closed.