     }
 
     private func createAsset(from sourceUrl: String?) -> AVURLAsset? {
-        guard let urlString = sourceUrl, let url = URL(string: urlString) else {
-            return nil
-        }
-
+        guard let urlString = sourceUrl, let url = URL(string: urlString) else { return nil }
         return AVURLAssetWithCookiesBuilder(url: url).asset
     }
 

            let position = player?.currentItem?.currentTime().seconds {
            return position - start
        }

        guard playbackType == .vod, let player = player else {
            return 0
        }
        return CMTimeGetSeconds(player.currentTime())
    }

    open override var playbackType: PlaybackType {
        guard let player = player, let duration = player.currentItem?.asset.duration else {
            return .unknown
        }

        return duration == CMTime.indefinite ? .live : .vod
    }


    private(set) var seekToTimeWhenReadyToPlay: TimeInterval?

    @objc internal dynamic var player: AVPlayer?
    private var playerLayer: AVPlayerLayer?
    private var playerLooper: AVPlayerLooper?
    private var playerStatus: AVPlayerItem.Status = .unknown
    private var isStopped = false
    private var timeObserver: Any?
    private var asset: AVURLAsset?
    private var backgroundSessionBackup: AVAudioSession.Category?

    var lastDvrAvailability: Bool?
    #if os(tvOS)
    lazy var nowPlayingService: AVFoundationNowPlayingService = {
        return AVFoundationNowPlayingService()
    }()
    #endif

    private var currentState: PlaybackState = .idle
    open override private(set) var state: PlaybackState {
        set {
            currentState = newValue
            updateAccesibilityIdentifier()
        }
        get {
            return currentState
