         super.init(options: options)
 
         if let urlString = options[kSourceUrl] as? String {
-            url = URL(string: urlString)
-        }
+            if let url = URL(string: urlString) {
+                asset = AVURLAsset(url: url)
+            }
+        }
+    }
+
+    public func setDelegate(delegate: AVAssetResourceLoaderDelegate) {
+        self.asset?.resourceLoader.setDelegate(delegate, queue: DispatchQueue(label: "\(String(describing: asset?.url))-delegateQueue"))
     }
 
     public required init?(coder _: NSCoder) {

    fileprivate var playerStatus: AVPlayerStatus = .unknown
    fileprivate var currentState = PlaybackState.idle
    fileprivate var timeObserver: Any?
    private var backgroundSessionBackup: String?

    open var url: URL?

    open override var pluginName: String {
        return "AVPlayback"

    }

    fileprivate func setupPlayer() {
        if let asset = self.asset {
            let item: AVPlayerItem = AVPlayerItem(asset: asset)
            player = AVPlayer(playerItem: item)
            player?.allowsExternalPlayback = true
            playerLayer = AVPlayerLayer(player: player)
            self.layer.addSublayer(playerLayer!)
