PallyCon FPS(FairPlay Streaming) iOS SDK Guide

PallyCon FPS iOS SDK makes it easy to apply Apple's FairPlay Streaming DRM when developing media service apps for iOS. This document describes how to use the libraries and sample projects included in the SDK.

Details of PallyCon Multi DRM service integration are provided in License Callback API and License Token API guides. For technical questions about using the SDK, please visit our Helpdesk site.

SDK products can be requested when subscribing to PallyCon cloud commercial service. Then SDK can be downloaded from the Download page of PallyCon admin site.


Supported Environments

  • iOS 9.0 or later
  • ARC(Automatic Reference Counting) required
  • This SDK has been tested on Xcode 8. It does not work on Simulator.

Prerequisites

  • The following items are needed to test your FPS HLS contents:
    • You need to sign up on PallyCon Admin Site, and get Site ID and Site Key from the site.
    • You need to acquire FPS Deployment Package from Apple, and send us FPS Certification file, Private Key file and FPS App Secret key(ASK) which are included in the package.
  • You cannot test PallyCon FPS SDK Sample to play FPS HLS content until the above is done.

NOTE:

Once the keys received from APPLE are registered on the PallyCon site, you need to encrypt the HLS content with Site ID and Site Key using PallyCon Packager.

Configuring your project

You can add PallyCon FPS SDK by following steps:

  1. Extract PallyConFPSSDK.zip file.
  2. Add the PallyConFPSSDK.framework library provided in the lib folder to your project.
    • Add the framework's path to Linked Frameworks and Libraries setting in Xcode General tab.
    • Add the framework's path to Framework Search Paths setting in Xcode Build Settings tab.
  3. Set Enable Bitcode in Build Settings tab to No.

Quick Start

The following code shows how to stream or download FPS HLS content using PallyConFPS SDK.

Streaming FPS content

// 1. initialize a PallyConFPS SDK.
do {
    let pallyconSdk: PallyConFPS = try PallyConFPSSDK(siteId:"Site ID", siteKey:"Site Key", fpsLicenseDelegate:"PallyConFPSLicenseDelegate")
} catch PallyConSDKException.DatabaseProcessError(let message) {
    print("PallyConFPSSDK initilize failed.\n\(message)")
}

// 2. Set parameters required for FPS content playback.
pallyconSdk.prepare(urlAsset:"Asset", userId:"User ID", contentId:"ContentID", optionalId:"optionalId")
// If you use a token, set the token information and call the method below. 
// pallyconSdk.prepare(urlAsset:"Asset", userId:"User ID",  contentId:"ContentID", token:"Token String")
// If you use a customData, set the customData information and call the method below.
// pallyconSdk.prepare(urlAsset:"Asset", customData:"CustomData")

Downloading FPS content

// 1. Create PallyConFPSSDK instance.
do {
    let pallyconSdk: PallyConFPS = try PallyConFPSSDK(siteId:"Site ID", siteKey:"Site Key", fpsLicenseDelegate:"PallyConFPSLicenseDelegate")
} catch PallyConSDKException.DatabaseProcessError(let message) {
    print("PallyConFPSSDK initilize failed.\n\(message)")
}

// 2. Create DownloadTask instance.
// You need to use DownloadTask instance for content download.
// DownloadTask should be created by PallyConFPS instance.
let downloadTask = pallyconSdk.createDownloadTask(url:"Content URL", userId:"User ID", contentId:"Content ID", optionalId:"Order ID", downloadDelegate:"PallyConFPSDownloadDelegate")
/**
If you use a token, set the token information and call the method below. 
let downloadTask = pallyconSdk.createDownloadTask(url:"Content URL", userId:"User ID", contentId:"Content ID", token:"Token String", downloadDelegate:"PallyConFPSDownloadDelegate")
*/

// 3. Start downloading content
// If the content download was canceled previously, it will be resumed.
downloadTask.resume()

// 4. Cancel download (if needed)
downloadTask.cancel()

Acquiring CustomData information

// 1. Create PallyConFPSSDK instance.
do {
    let pallyconSdk: PallyConFPS = try PallyConFPSSDK(siteId:"Site ID", siteKey:"Site Key", fpsLicenseDelegate:"PallyConFPSLicenseDelegate")
} catch PallyConSDKException.DatabaseProcessError(let message) {
    print("PallyConFPSSDK initilize failed.\n\(message)")
}

// 2. Acquire a CustomData information
do {
    let customDataInfo: PallyConTokenInfo = try pallyconSdk?.getCustomDataInfo(from:"CustomData")
} catch PallyConSDKException.InvalidParameter() {
    print("PallyConFPSSDK invalid customData")
}

Acquiring Token information

// Acquire a Token information
let tokenInfo: PallyConTokenInfo = PallyConFPSSDK.getTokenInfo(from:"Token String")

API References

For descriptions of all the APIs provided by PallyCon FPS iOS SDK, see the API reference documentation included in the SDK file.


results matching ""

    No results matching ""