Tags

About Me

I'm Rolf Kaiser. I've ridden the wave from 3-guys-in-a-garage, to an acquisition by a big software company, and have built a string of startups since. This blog is a little compendium of tips and tricks so hopefully the next guy doesn't have to reinvent the wheel.

P.S. the tagline is a sailing reference.

Building a Vista Media Center plugin

All I want to do is watch hulu.com movies on my TV instead of my laptop. This is much easier said than done though. The development tools seem to have stalled a few years ago. Is anyone else writing these things these days?

This post gives bad news: Flash is not coming to MCE anytime soon. So in order to get the Flash videos playing you have to render the ordinary Flash object inside a page, and have the plugin navigate to that page.

First off, I’m not the only one doing this. TunerFreeMCE, a closed-source plugin written by the author of the blog above, does the same thing for BBC shows and Hulu. Unfortunately it seems broken at the moment for Hulu content, but that’s probably easily fixed. Perhaps they changed their HTML format or something.

Main things I learned in the writing of my first plugin:

The Media Center SDK version 5.3 (which I think is the latest) has some issues.

It contains a solution (MCMLSampler) that doesn’t build in VS 2008. It can’t find any of the MediaCenter DLL references, and try as I might I couldn’t add them manually either. So you can use the solution to browse the code but you can’t build it.

Don’t forget to edit DevInstall.cmd if you add any non-DLL’s to your plugin; otherwise they won’t get copied to Program Files.

DevInstall.cmd /u /debug works but DevInstall.cmd /debug /u does not.

The design and debugging process leaves a lot to be desired.

I haven’t found any way to F5-debug the application directly. I can install the plugin into MCE via DevInstall.cmd (which installs it into the GAC) and then attach to the process but that’s it. If you set the registry key in C:\Program Files\Microsoft SDKs\Windows Media Center\v5.0\Tools you end up spawning a dialog window upon launch to give time to attach to the process. This post recommends a macro to make it quicker but I haven’t tried it.

You can debug your markup via F5-debug but it will crash if you have any code-behind dependencies. This makes it fairly useless IMHO.

I did find the MCMLookalike project to develop open-source templates plugin developers could use to better match the MCE UI. It ceased last year due to a lack of community support but it was really helpful to see how a good MCE developer would write the MCML. You have to dig for the source code, but it’s there. I had to rebuild the VS 2008 project to get it running; that’s available here: mcmlookalike-vs2008.zip

You can set several command-line options in MCMLPad during debugging. I added screen resolution, for example, so in the “Command-line arguments” under the Debug tab, I have the following to test 1280×720 (what the default “windowed”) launch of MCE is on Vista):