HTTP Live Support

From DevWiki

Jump to: navigation, search


What is HLS

HTTP Live Streaming (also known as HLS) is an HTTP-based media streaming communications protocol implemented by Apple Inc. as part of their QuickTime X and iPhone software systems. The technology is based on the Emblaze Network Media Streaming technology that was first released on 1998. It works by breaking the overall stream into a sequence of small HTTP-based file downloads, each download loading one short chunk of an overall potentially unbounded transport stream. As the stream is played, the client may select from a number of different alternate streams containing the same material encoded at a variety of data rates, allowing the streaming session to adapt to the available data rate. At the start of the streaming session, it downloads an extended M3U playlist containing the metadata for the various sub-streams which are available.

Since its requests use only standard HTTP transactions, HTTP Live Streaming is capable of traversing any firewall or proxy server that lets through standard HTTP traffic, unlike UDP-based protocols such as RTP. This also allows a Content delivery network to easily be implemented for any given stream.[1]

Apple has documented HTTP Live Streaming and submitted the draft to the IETF. You can view it here.

Playlist Protocol

Boxee uses a custom protocol, 'playlist://', for passing HLS parameters to the player. Different parameters can be passed via this protocol to setup your stream.

Parameter Description
quality Sets the bitrate quality for the given stream. (0, 1, A) Where A=Adaptive 1=High 0=Low.


Below is a basic example.
Download this test application.

  1. import mc
  2. from urllib import quote_plus, urlencode
  4. def playHlsStream(stream):
  5.    #set playlist stream bandwith, 0, 1, A (low, high, adaptive)
  6.    params = { 'quality': stream['quality'] }
  8.    #build stream url
  9.    playlist_url = "playlist://%s?%s" % (quote_plus(stream['url']), urlencode(params))
  11.    #build Boxee listitem and set properties
  12.    item = mc.ListItem(mc.ListItem.MEDIA_VIDEO_EPISODE)
  13.    item.SetPath(playlist_url)
  14.    item.SetLabel(stream['title'])
  15.    item.SetContentType('application/')
  17.    #initialize the Boxee player and pass our listitem
  18.    mc.GetPlayer().Play(item)
  21. my_stream = {
  22.    'url':      '',
  23.    'quality':  'A',
  24.    'title':    'My HLS Test Stream'
  25. }
  27. playHlsStream(my_stream)

Ongoing Development

We are actively working to improve our HLS support within Boxee and always welcome additional streams to test! If you run across playback issues please contact me at riegersn at boxee dot tv. We are currently working to improve playback for future versions.

Personal tools