Skip to content

SRGSSR/srgcontentprotection-apple

Repository files navigation

SRG Content Protection logo

GitHub releases platform SPM compatible GitHub license

About

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.

Compatibility

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.

Contributing

If you want to contribute to the project, have a look at our contributing guide.

Integration

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.

Usage

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

Playing a protected media

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.

Known limitations

FairPlay stream playback requires a physical iOS device. Streams will not play in the simulator.

License

See the LICENSE file for more information.