The SRG Content Protection framework contains the logic required for encrypted media playback. The following protection measures are currently supported:
- Akamai secure token.
- Digital Rights Management via FairPlay.
The library is suitable for applications running on iOS 12, tvOS 12 and above. The project is meant to be compiled with the latest Xcode version.
If you want to contribute to the project, have a look at our contributing guide.
The library must be integrated using Swift Package Manager directly within Xcode. You can also declare the library as a dependency of another one directly in the associated Package.swift
manifest.
When you want to use classes or functions provided by the library in your code, you must import it from your source files first. In Objective-C:
@import SRGContentProtection;
or in Swift:
import SRGContentProtection
To play a protected content with AVPlayer
, create an asset through one of the methods from the AVURLAsset (SRGContentProtection)
category, and use it to instantiate the AVPlayerItem
which will be played.
If the protection used does not match the one required by the content, playback will likely fail.
FairPlay stream playback requires a physical iOS device. Streams will not play in the simulator.
See the LICENSE file for more information.