Tips for HTML Add Ins in XP Media Center Edition 2005

HTML Add-ins for Media Center are really quite easy to develop once you get the hang of it.  I would like to post a few helpful tips for getting up and running quickly.


First, some information on developing HTML Add-ins-


1. The user interface options are limited only to what you can do in IE!


2. In an HTML add-in, you have full access to the Media Center API’s through the browser.  Just about anything you can do with a web application can be done in Media Center!     This includes calling web services (directly from the browser) using the DHTML webservice behavior.


3. You can easily code event sinks for the remote control by simply using an OBJECT tag in IE.  (See “Search.htm“ example in the SDK, and MSDN for object model information)


Some tips and tricks for getting started with HTML applications:


1. Be sure to download the Media Center 2005 SDK.


2. A good reference about registering add-ins with MCE can be found on MSDN.


3. Be sure to visit Micheal Creasy’s (MSFT) blog.


You may want to tweak the CSS that comes with the SDK to get a true Media Center look and feel. For whatever reason, MSFT decided to provide a non-standard looking CSS for the SDK.  It consists of grey, black, and orange. 🙂 


1. Hence, you may want to get the CSS Color scheme from MCE 2004 . Keep in mind that there are some behavior tags embedded in the SDK CSS that you will probably want to keep, so you will need to duplicate those.


2. I will try to provide an updated CSS with the appropriate behavior tags so you may simply replace the one in the SDK in the near future.


Creating your Add-in


1. Use your favorite HTML editor. Copy all the javascript, htc, and CSS files from the SDK into your local directory.


2. Create your application… If you want to call web services from the browser, check out the MSDN web service behavior


3. Create an XML file that Media Center registration tool can read. You will need to do this in order to register your application in Media Center.  There are two steps:


3a.  Generate a guid using the guidgen tool. (Go to “Visual Studio Comnand Prompt“ and you can type in guidgen at the command line.) You will need this guid because when media center installs your application it needs to put it in the registry. 


3b. Create your xml file as such- this will add the application in the “More Programs“ category:


<application
<APPLICATION
    title = “Browse Movies”
    id=”{CCA64374-182E-43d8-9F7A-6DBBC4AEA4F0}”
    CompanyName=”Bestcoding.com”>


<ENTRYPOINT
 
<entrypoint  id=”{CCA64374-182E-43d8-9F7A-6DBBC4AEA4F1}”
                      url=”.\BrowseMovies.html”
                      title=”Browse Movies”
                      description=”Browse Movies”
                      ImageUrl=”.\Photo1.gif\”>”
                      <category category=”More Programs”/>
</entrypoint>
</application>



4. Load up media center and your application should be registered!


 

70 thoughts on “Tips for HTML Add Ins in XP Media Center Edition 2005

  1. Is this the only way to make application for MCE?

    So I cannot make a win form application and, for example,

    -let the user fully interact with the hardware as to drive an external device

    -build a rich UI with all the advantages of winform UI

    ?

  2. What about using MSXML.XMLHTTP for making the web requests? And what about parsing the results? I’ve had some problems loading the MSXML ActiveX control and had to have my site as a tusted site to make it work. Howeverm this seems a bit to much for most users. Do you have any tips?

Leave a Reply

Your email address will not be published. Required fields are marked *