Update: I’ve made a bookmarklet to create a popup window of the HLS stream if you’re using Safari on Mac OS X.

One of the last things I still use Flash for is watching streams on Twitch. I don’t really mind it on my desktop, but it drains battery like crazy on my MacBook Pro. My battery lasts for about 1.5 hours while watching streams, compared to around 4 hours for normal use (browsing the web, etc.).

It turns out Twitch did some work on streaming with HLS, but there doesn’t seem to have been much progress and the ETAs given in that thread by Twitch staff have long passed. HLS is Apple’s HTTP Live Streaming protocol, which is supported by Safari on Mac OS X and iOS, as well as various other clients.

The trick to watch a stream through HLS is just adding /hls to the URL, for example:

http://www.twitch.tv/riotgames/hls

The above URL looks like this in Safari (but will work in any HLS player):

Twitch using HLS

A great part of this is that only one ad seems to run — right when you open the stream. After that, it’s ad-free for as long as I’ve been using it. I had to disable Adblock for the stream to load, using the filter rule below. It seems if you block the ad video, the stream won’t load at all.

@@|http://www.twitch.tv/*/hls|$document

Disadvantages

  • Quality is automatically determined, and there’s no manual setting
  • You have to play the ad at the beginning for it to work, but that’s the only one
  • No access to chat, but this could be considered a feature…

Power Savings

Example of Flash being power hungry

As you can see in this screenshot of Activity Monitor’s Energy tab, the Flash player was using more than 5 times the energy that the native HLS player is using.

3 Comments

  • Well, this certainly doesn’t work for any recorded streams, which is what I usually watch. It’ll just show a 404 if you do. Was hoping for a userscript of some kind, ah well.

    • I rarely if ever watch recorded streams so I actually never thought to test it with those. I’ll take a look at that when I get a chance, though.

      And making it all an user script is a great idea. Especially if it can just replace the flash player with the HLS player, so you wouldn’t need the popup. I’ll see what I can do.

  • Excellent post. Some additional information for non-Mac users that are looking for for alternatives to Flash:

    There exists a program named Livestreamer (http://livestreamer.readthedocs.org/en/latest/) that loads the stream for Twitch.tv/Justin.tv and then redirects it to VLC (a free media player for Windows). Works great.

    I realize this isn’t HTML5 and isn’t quite the same, but if you are like me and are searching for something other than Flash to watch steams in and found this excellent page, this might help until Twitch adds true HTML5 support.

    Hope that helps someone!