         }
       }
     }
+    
+    if !isPreroll {
+      self.adDidFinishPlaying()
+    }
+    
     contentPlayer.addPeriodicTimeObserver(forInterval: CMTime(value: 1, timescale: 1), queue: .main) { _ in
       self.linearAdCountDown.isHidden = true
       guard let nearestLinear = linearTimes.filter({ $0.timeValue > self.contentPlayer.currentTime()}).first else {


@objc public class AdsManager: NSObject {
  public static var apiKey: String?
  public static var debug = false
  public static var current: AdsManager?
  public var instreamOffset: CGFloat = 0 {

    TrackingManager.shared.currentAdBreak = adBreak
    guard
      let tag = adBreak["vmap:AdSource"]["vmap:AdTagURI"].element?.text?.trimmed,
      let ssp: String = try? adBreak["vmap:AdSource"]["vmap:AdTagURI"].value(ofAttribute: "ssp"),
      let type: String = try? adBreak.value(ofAttribute: "breakType")
    else {
      self.adDidFinishPlaying()
      return
    }
    
    var urlString = tag
    
    switch ssp {
    case "quadas":
      urlString = urlString.replacingOccurrences(of: "[IDFA]", with: IDFA.shared.identifier ?? "[IDFA]")
      urlString = urlString.replacingOccurrences(of: "[APPID]", with: AdsManager.iTunesId ?? "[APPID]")
    default:
      urlString = urlString.replacingOccurrences(of: "[timestamp]", with: "\(self.correlator)")
    }
    
    guard let url = URL(string: urlString) else {
      self.adDidFinishPlaying()
      return
    }
    
    url.fetch(closeAdWhenError: true) { [type] in
      let vast = SWXMLHash.parse($0)
      switch vast["VAST"]["Ad"] {
