Skip to content

Instantly share code, notes, and snippets.

View ajeetpratap's full-sized avatar

Ajeet Pratap Maurya ajeetpratap

View GitHub Profile
@ajeetpratap
ajeetpratap / FairPlayer.swift
Created March 15, 2022 12:04 — forked from fousa/FairPlayer.swift
Integrate HLS with FairPlay.
class FairPlayer: AVPlayer {
private let queue = DispatchQueue(label: "com.icapps.fairplay.queue")
func play(asset: AVURLAsset) {
// Set the resource loader delegate to this class. The `resourceLoader`'s delegate will be
// triggered when FairPlay handling is required.
asset.resourceLoader.setDelegate(self, queue: queue)
// Load the asset in the player.