HOW-TO:Use Netflix via an external player

From XBMC
Jump to: navigation, search

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.

Contents

1 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

2 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:

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

  <rules action="prepend">
    <rule name="htm" filetypes="htm" player="IExplore" />
  </rules>
</playercorefactory>

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 <player name="IExplore" type="ExternalPlayer"> section inside the existing <players> section, and add the line <rule name="htm" filetypes="htm" player="IExplore" /> to the existing <rules> section.

3 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:

<advancedsettings>
  <videoextensions>
    <add>.htm</add>
  </videoextensions>
</advancedsettings>

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 <videoextensions> section, or if you already have a <videoextensions> section just add the line <add>.htm</add>.

4 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:

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

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

<meta http-equiv="REFRESH" content="0;url=http://www.netflix.com/">

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 <title> and in the body to remind you where the .htm file redirects, but this isn't compulsory.

Personal tools
Namespaces

Variants
Actions
Google Search
Navigation
Wiki help
Toolbox