title: How to implement video DRM in iOS
body: <p>I'm looking to implement DRM in an iOS video player, but I'm not sure how to implement this. In order to implement video DRM (while still using Apple's hardware accelerated H264 decode), I need a way to feed the decrypted H264 stream into the standard iOS video playback APIs.</p>
  
  <p>According to <a href="https://stackoverflow.com/a/3682640/184998">this question</a>, it was not possible to implement 3rd party DRM in September 2010. There's a <a href="https://devforums.apple.com/message/695359#695359" rel="noreferrer">thread in the Apple Developer Forums</a> that goes nowhere. However, as of today a number of 3rd party DRM libraries exist: <a href="http://www.widevine.com/available_platforms.html" rel="noreferrer">Widevine</a>, <a href="http://irdeto.com/documents/SO_AC_OTT_iPad_EN_L.pdf" rel="noreferrer">Irdeto (PDF)</a>, <a href="http://irdeto.com/documents/SO_AC_OTT_iPad_EN_L.pdf" rel="noreferrer">Marlin</a>. They have clearly found some way to pass a custom stream to the media player in Apple approved apps. </p>
  
  <p>I've found two leads. One is a suggestion to <a href="http://aptogo.co.uk/2010/07/protecting-resources/" rel="noreferrer">create a custom URL protocol</a>, but people seem to have poor success using this with video. The other is to create a local HTTP server thread and provide the content by HTTP live streaming on 127.0.0.1 inside the iDevice. I'd like to be very sure that Apple will approve before going that route.</p>
  
  <p>So - what Apple approved APIs do 3rd party DRM implementations use to get decrypted video data into the video player?</p>
  
  <p>Edit: the <a href="http://www.bbc.co.uk/blogs/bbcinternet/2012/09/iplayer_mobile_downloads.html" rel="noreferrer">latest BBC iPlayer for iOS</a> allows programmes to be downloaded for later viewing. Either they store the content in the clear, or they have cracked this problem.</p>