Embedding Videos With Windows Live Writer and MetroPress

The Problem

Windows Live Writer, IMO, is still the best little tool out there for creating content for blogs. It does a great job at nearly every task related to editing post, pages, categories and tags, and it provides flexible posting options with the ability to manage multiple blogs.

But, at times, she’s verbose! Embedding a YouTube video, for instance, inserts the following code into your post:


<div id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:befb91d4-acb8-41d9-a0da-ec64375d826f" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><embed src="http://www.youtube.com/v/uA7Z8WfD3bU?hd=1" type="application/x-shockwave-flash" wmode="transparent" width="448" height="252"></embed></div>
Unfortunately, that breaks [MetroPress](http://metropress.codeplex.com/) because the embed tag and script cannot load inside a Windows Store app. The fix is quite simple: rather than using the built-in “Insert Video” feature, you simply need to copy and paste the embed code from YouType, which looks more like this:
<iframe width="560" height="315" src="http://www.youtube.com/embed/uA7Z8WfD3bU" frameborder="0" allowfullscreen></iframe>

This embed code is snapped from Share –> Embed on the YouTube site under your video.

image

You can see that the new embed code is cleaner, and better still it is allowed in a Windows Store app and the video plays embedded in your posts just fine.

image

A Little Background

MetroPress is a handy way to augment your blog with an offline-capable reader for your followers.  From their site:

In a nutshell, this framework is a flexible app template that can be easily customized and extend it to create more awesome Windows store applications.

Using the quickstart, it takes about an hour to get your blog prepped and the project built up so that you can release a Windows Store (Windows 8) application.  Mine passed certification on the first attempt.

You can get MetroPress on their CodePlex project site.