     
     addSubview(close)
     constrain(close, image) {
-      $0.0.centerX == $0.1.right
-      $0.0.centerY == $0.1.top
-      $0.0.height == 44
-      $0.0.width == 44
-    }
-
+      if type == .instream {
+        $0.0.centerX == $0.1.right
+        $0.0.centerY == $0.1.top
+        $0.0.height == 44
+        $0.0.width == 44
+      } else {
+        $0.0.right == $0.1.right
+        $0.0.top == $0.1.top
+        $0.0.height == 14
+        $0.0.width == 14
+      }
+    }
+    
     close.isHidden = true
     close.addTarget(self, action: #selector(NonLinearView.dismissAds), for: .touchUpInside)
     
     let tap = UITapGestureRecognizer(target: self, action: #selector(NonLinearView.clickThrough))
     image.isUserInteractionEnabled = true
     image.addGestureRecognizer(tap)
+
+  }
+  override init(frame: CGRect) {
+    super.init(frame: frame)
   }
   required init?(coder _: NSCoder) {
     fatalError("init(coder:) has not been implemented")

    }
  }
  let image = ImageView()
  let close = CloseButton(type: .system)
  let group = ConstraintGroup()
  var adParameters: [String: String] = [:] {
    didSet {

    return "\(offset) - \(breakId)(\(breakType)) \n\(url)\n\n"
  }
}
enum AdType {
  case instream
  case outstream
}
class NonLinearView: UIView {
  var isAdHidden = true {
    didSet {
