     
     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")

  var adsManager: IMAAdsManager!
  let contentVideoView: UIView
  var outstreamContainer: UIView?
  let instream = NonLinearView(frame: .zero)
  let outstream = NonLinearView(frame: .zero)
  let correlator = Int(Date().timeIntervalSince1970)
  var timeObserver: Any?


        default: break
        }
      }
      guard let heightPercentage = Float(adParameters["height"] ?? "100") else { return }
      constrain(image, replace: self.image.imageSize) {
        $0.width == self.bounds.width
        $0.height == self.bounds.height * CGFloat(heightPercentage * 0.01)
      }
    }
  }
  convenience init(type: AdType) {
    self.init(frame: .zero)
    close = type == .instream ? CloseButton(type: .system) : SquareCloseButton(type: .system)
    clipsToBounds = true
    image.clipsToBounds = true
    addSubview(image)
