Skip to content

MostafamShuman/FairPlay-iOS-Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation


Logo

iOS FairPlay Streaming

FairPlay Streaming Programming Guide!

Table of Contents
  1. About FairPlay Streaming
  2. Prerequisites
  3. Getting Started
  4. License
  5. Contact
  6. Acknowledgements

About The FairPlay Streaming

Apple FairPlay Streaming (FPS) securely delivers keys to Apple mobile devices, Apple TV, and Safari on macOS and iOS, which will enable playback of encrypted video content. This content is delivered over the Web using HTTP Live Streaming (HLS) technology. FPS protects the delivery of keys that decrypt streamed audio and video media. An Apple device or computer can securely acquire a key from a content provider's key server. The operating system uses the key to decrypt the media before playback. FPS key delivery offers the following features:

  • AES 128-bit content keys are generated by the key server.
  • Every key is known only to the key server and to the Apple device.
  • When playback is stopped, the key for the iOS device, Apple TV, or Safari on macOS and iOS is permanently discarded from memory.
  • The key server can specify the duration of the key's validity for iOS and Apple TV.
  • MPEG-2 file formats are supported for protection.
One key thing to note is Fairplay HLS streaming will only work on a real Apple device, not on a simulator.

Prerequisites

  • Manifest URL of the HLS stream.
  • Fairplay Application certificate of the content provider.
  • Content Identifier.
  • Key Server Module or DRM server URL

Getting Started

Product Name Screen Shot

Now, getting down to how exactly it works on the media player because we need to have a clear understanding of this process.

So, breaking it in steps

  1. The app asks the the native player to play specific content identified by a URL, here we give the manifest URL to the AVPlayer.

    https://videodrmmediaservice-euwe.streaming.media.azure.net/3eb925e7-04fa-4a02-8d3m-2b0d9a864keb/test.ism/manifest(format=m3u8-aapl,encryption=cbcs-aapl)
  2. The player accesses the content and checks its playlist.

  3. An attribute in the playlist identifies the content as encrypted by a content key obtainable through FPS.

  4. The iOS informs the app that the content is encrypted using FPS, (here an implemented AVAssetResourceLoaderDelegate protocol method will be invoked in application code)

  5. The app asks the iOS to prepare an FPS message that requests the content key.

  6. The iOS delivers an encrypted Server Playback Context (SPC) message to the app.

  7. The app sends the SPC to a key server that contains a KSM.

  8. The KSM decrypts the SPC and gets the requested content key from the key server.

  9. The KSM wraps the content key inside an encrypted content key context (CKC) message, which it sends to the app.

  10. The app delivers the CKC to FPS software integrated in the operating system. The CKC is used to decrypt the media content and plays the content.

License

Distributed under the MIT License.

Contact

Mostafa Shuman - @twitter - mostafa.shuman@hotmail.com

Acknowledgements

About

FairPlay Streaming Programming Guide!

Topics

Resources

License

Stars

Watchers

Forks