Pipelight
Silver Screen
Video-on-demand services often don't play well with Linux because they depend on Microsoft's Silverlight browser plugin. Luckily, you can call on the Wine offshoot Pipelight to rescue your next home movie night.
Video-on-demand services such as Netflix or Hulu are so firmly established in the United States that they actually produce their own exclusive series, such as the political thriller House of Cards. For many users, video-on-demand is the new TV, and millions of modern couch potatoes are actually cancelling conventional cable television services so they can watch their favorite programs on their computer or mobile devices.
Unfortunately, most video-on-demand services do not officially support Linux because they rely on the Silverlight browser extension [1]. Silverlight was developed by Microsoft and is only available for Windows and Mac, with no plans to support free operating systems. The Linux alternative, Moonlight [2], once developed jointly by Microsoft and Novell, never did support the same DRM functions used with Silverlight and has since been dropped.
The good news is that this lack of Silverlight support doesn't mean Linux users won't have their cozy video evenings. A Linux tool called Pipelight [3] lets browser plugins designed for Windows – including Silverlight, Flash, and Shockwave – run on Linux.
Pipelight works its magic thanks to a Windows program that relies on a customized version of the Wine Windows runtime environment to trick the plugin into believing it is using a Windows browser then passes the output through to the Linux browser. Video streams transmitted via Silverlight, such as those of Amazon Prime Instant Video (Figure 1), arrive at the Linux desktop without any noticeable delay.
Installing Silverlight
The Pipelight developers give installation instructions for many Linux distributions on the project website [4]. On Ubuntu, your best bet is to use the Pipelight-stable PPA [5], as shown in Listing 1. For Debian or Arch Linux, the developers also offer separate repositories. On Fedora and openSUSE, the Pipelight developers use the openSUSE Build Service, which you can easily use to install Pipelight. Alternatively, you can compile Pipelight from the source code; see the project homepage for help with compiling Pipelight from source. Because of the size of the Wine project, compiling takes a considerable amount of time, even on fast computers.
Listing 1
Installing the Pipelight Plugin
After setting up the Pipelight browser plugin, you will have to load a Windows plugin (e.g., Silverlight). Pipelight shows the required commands when you type pipelight-plugin --help
. As shown in line 1 of Listing 2, you can enable the current version of Silverlight or explicitly enable a specific version.
Listing 2
Enabling Silverlight
Depending on whether you run the commands as root or as a normal user, you can either install the plugins globally or for the current user. The next time you start the browser, the Pipelight plugin automatically downloads the current Silverlight plugin off the web. If Silverlight 5.0 and 5.1 are installed at the same time, the browser will automatically use the newer version.
To disable a plugin, you can use the --list-enabled
or --list-enabled-all
options to output the commands for local or global plugins. Then disable the plugins either individually with --disable plugin_name
or all in one fell swoop with --disable-all
(Listing 3). To uninstall global plugins, you need root privileges.
Listing 3
Disabling Plugins
After you install the plugin, check the configuration of the Silverlight-Pipelight-Wine-browser chain, preferably by running the Silverlight Balls animation test [6] or the Smooth Streaming test services provided by Microsoft. These tools indicate whether the computer is fast enough to handle high-definition 720p [7] or 1080p movies [8] smoothly. The Silverlight Balls test should reach 150 fps; the Smooth streaming demos should come as close as possible to the optimum refresh rate of 25 fps (Figure 2).
Changing the User Agent
After completing the tests, you don't really need to worry about anything else. The Pipelight plugin, and thus also Silverlight, automatically loads when a web page requests a function that needs it. As far as the Internet service knows, you are using a Windows machine. However, simply having Silverlight/Pipelight installed as a plugin in the browser is not always enough. You sometimes need to persuade video-on-demand providers to cooperate by changing the browser identification.
Several open source browsers have extensions that allow the user agent to spoof a "Windows" computer when talking to the web server. For Chrome and Chromium [9], Firefox [10], or Opera [11], look for the plugin in the add-on store. Changing the user agent is no longer compulsory, since the update to Pipelight 0.2.6, but numerous video services tested continue to require this trick (see Table 1).
Table 1
Video Services and Pipelight
Service | Requires | User Agent |
---|---|---|
Amazon Prime Instant Video |
Silverlight 5.1 |
Yes |
Magine |
Silverlight 5.1 |
No |
Maxdome |
Silverlight 5.1 |
Yes |
Sky Go |
Silverlight 5.0 |
Yes |
Watchever |
Silverlight 5.1 |
No |
You might need to find the correct user agent string through trial-and-error. Usually it helps to choose a browser identifier that corresponds to the Windows version of the web browser you are currently using.
My experience shows that it is generally useful to spoof a Firefox browser on Windows 7 ("Windows NT 6.1"). Listing 4 shows browser identifiers that you can enter in the user agent changer by hand. However, always avoid spoofing Internet Explorer: If you say you are using IE, the web server usually tries to call Active X – which will cause trouble for a Linux system.
Listing 4
Common Browser Identifiers
Listing 5
pipelight.ds
Linux Video-on-Demand
With a Windows user agent and the current Silverlight 5.1, you will be fine with most of the video services we tested. (See the box titled "Full Screen in Gnome 3" for a workaround with Silverlight on the Gnome desktop.) The online TV provider Magine and the on-demand video Library, Watchever, do not even complain if you have an unmodified Linux identifier for the browser – at least for Google Chrome.
Full Screen in Gnome 3
When playing Silverlight movies on the Gnome 3 desktop, you will notice a bug with full-screen mode in the Gnome Shell [12]. Full-screen video only appears for a brief moment and then immediately disappears. In the browser, you only see a black box instead of the movie. The developers are already working on fixing the bug, but you currently need a workaround.
To watch Pipelight videos in the Gnome Shell in full-screen mode, switch to the activities overview after enabling full-screen mode – either by clicking on Activities, or by dragging the mouse pointer to the upper left corner of the screen. Then, look for the video window (Figure 3).
If this solution does not work, use Devilspie for reliable full-screen viewing. Devilspie is a utility that lets you "make applications start in specified workplaces, in specified sizes and placements, minimized or maximized." Install Devilspie using your distro's package management system and create a ~/.devilspie/pipelight.ds
file with the contents of Listing 3. Then start Devilspie with the devilspie
command. From now on, Devilspie will recognize the full-screen window opened by Silverlight and automatically move it to the foreground.
For the other providers, you will want to change the browser identification before opening the page. If the service still complains about a Linux browser even after changing the user-agent strings, you will need to delete the cookies for the website. (Cookies often contain information about the browser you are using.)
The Sky Go Internet television service works on most Linux systems but only with Silverlight 5.0. The stricter DRM encryption in Silverlight 5.1 leads to problems.
If you are using Sky Go, it is better to stick with Silverlight 5.0. However, you cannot have both versions of Silverlight at the same time – the browser always uses the latest version. For Sky Go or other services that have a similar problem, you need to disable Silverlight 5.1, as shown in Listing 6, and enable version 5.0. For other video services, switch back to Silverlight 5.1. Use the command pipelight-plugin --list-enabled-all
to check whether Silverlight 5.0 really is the only active version.
Listing 6
Enabling an Older Silverlight
Buy this article as PDF
(incl. VAT)