HOW-TO:Use Netflix via an external player

The Netflix web site uses Microsoft Silverlight, and this makes it hard to support in XBMC. This article describes a workaround that uses Internet Explorer as an external player. This technique can be used with any web site that you want to use from inside XBMC.

The idea is that you write a .htm file with a redirect to the web site of your choice (details below) and you configure Internet explorer as an external player for the .htm file type. When you select the .htm file XBMC fires up IE and loads that file. The redirect in the file then takes you to the web site you want.

Obviously Internet explorer doesn't exist in Linux, though you can use the same technique to open any browser, so I'll concentrate on Windows in the rest of this article.

Changes required in the userdata folder
To make this work you need to create the following two files in your userdata folder:

playercorefactory.xml advancedsettings.xml

If these already exist you're probably familiar with editing these files so you can skip the rest of this section.

The userdata folder is %APPDATA%\xbmc\userdata, where %APPDATA% is an environment variable that varies depending on what version of Windows you use. For example on my PC runnings Windows 7 my %APPDATA% is C:\Users\renniej\AppData\Roaming.

Note that %APPDATA% contains the username ("renniej" in my case). This means that if several different users are using the same PC each user has their own userdata folder so changes you make to one user won't affect the others. If you really really want your changes to affect all users you can use portable mode.

A quick way to open your userdata folder is to click Start then Run, or in Win7 click Start then All Programs then Accessories then Run, or press the keyboard shortcut Windows-R, then when the Run dialog opens type in:

%APPDATA%\XBMC\userdata

playercorefactory.xml
Press Windows-R (or Start then Run, etc) and in the Run dialog type in:

notepad %APPDATA%\XBMC\userdata\playercorefactory.xml

If you're asked whether you want to create a new file answer "Yes". Now copy and paste the following then save the file:

&lt;playercorefactory&gt; &lt;players&gt; &lt;player name="IExplore" type="ExternalPlayer"&gt; &lt;filename&gt;c:\Program Files\Internet Explorer\iexplore.exe&lt;/filename&gt; &lt;args&gt;-k "{1}"&lt;/args&gt; &lt;hidexbmc&gt;false&lt;/hidexbmc&gt; &lt;hideconsole&gt;false&lt;/hideconsole&gt; &lt;warpcursor&gt;none&lt;/warpcursor&gt; &lt;/player&gt; &lt;/players&gt;

&lt;rules action="prepend"&gt; &lt;rule name="htm" filetypes="htm" player="IExplore" /&gt; &lt;/rules&gt; &lt;/playercorefactory&gt;

This defines Internet Explorer as an external player for the .htm file type.

More details on external players are available from http://wiki.xbmc.org/index.php?title=HOW-TO_use_an_External_Player_for_media_playback if you want to tweak the config to your own purposes.

If you already have a playercorefactory.xml file then you just need to add the &lt;player name="IExplore" type="ExternalPlayer"&gt; section inside the existing &lt;players&gt; section, and add the line &lt;rule name="htm" filetypes="htm" player="IExplore" /&gt; to the existing &lt;rules&gt; section.

advancedsettings.xml
Press Windows-R (or Start then Run, etc) and in the Run dialog type in:

notepad %APPDATA%\XBMC\userdata\advancedsettings.xml

If you're asked whether you want to create a new file answer "Yes". Now copy and paste the following then save the file:

&lt;advancedsettings&gt; &lt;videoextensions&gt; &lt;add&gt;.htm&lt;/add&gt; &lt;/videoextensions&gt; &lt;/advancedsettings&gt;

This adds .htm as a video type. It might seem a little odd to define .htm as a video type, but it works.

If you already have an advancedsettings.xml file then you just need to add the &lt;videoextensions&gt; section, or if you already have a &lt;videoextensions&gt; section just add the line &lt;add&gt;.htm&lt;/add&gt;.

Creating the .htm files
The last task is to create a .htm file for every site that you want to browse. The .htm files are effectively media files, so you put them in whatever directory you use for your videos. The exact location is up to you. I use D:\XBMC\Video as the top level folder for my videos, so I have put my .htm files in D:\XBMC\Video\StreamingVideo.

This is an example .htm file to go to the Netflix site:

&lt;html&gt; &lt;head&gt; &lt;title&gt;Redirect to Netflix&lt;/title&gt; &lt;meta http-equiv="REFRESH" content="0;url=http://www.netflix.com/"&gt; &lt;/head&gt; &lt;body&gt; &lt;p&gt;Opening Netflix, please wait ...&lt;/p&gt; &lt;/body&gt; &lt;/html&gt;

The only bit of this file that matters is the line:

&lt;meta http-equiv="REFRESH" content="0;url=http://www.netflix.com/"&gt;

This line tells Internet Explorer (or indeed any browser) to redirect to the web site you specify i.e. http://www.netflix.com/ in this example. You can change the text in the &lt;title&gt; and in the body to remind you where the .htm file redirects, but this isn't compulsory.