AVContentKeySession API equivalent on MacOS/Safari?

228 views Asked by At

I am implementing a Fairplay Streaming player on Safari.It needs to prefetch a set of keys from KSM before the playback. All the examples I came across implement AvContentKeySession api but it is available only in Swift and Objective-C(for ios). What is equivalent of AVContentKeySession API on MacOS/Safari? Is there a reference code available to implement such a functionality on MacOS/Safari?

1

There are 1 answers

0
MGY On

Availability

Here is the availability list per OS, from the documentation:

iOS 10.3+ macOS 10.12.4+
Mac Catalyst 13.0+
tvOS 10.2+
watchOS 7.0+

That means it's available on macOS 10.12.4 and later.

Safari

Apple has an official example project for this (the next title), under the project you can find the FairPlay Streaming in Safari directory which includes an example for Safari.

Official Example

Check the Official Example here. And here is the URL for today's updated example as a zip. Warning: You need to have an Apple Developer membership to download this.

Helpful Resources

The following resources available on the Apple Developer website contain helpful information that you may find useful.