     NotificationCenter.default.addObserver(self, selector: #selector(bringToFront), name: .PictureInPictureUIWindowDidAddSubview, object: nil)
     NotificationCenter.default.addObserver(self, selector: #selector(addSubviewOnKeyWindow), name: .UIWindowDidBecomeKey, object: nil)
     NotificationCenter.default.addObserver(self, selector: #selector(orientationDidChange), name: .UIDeviceOrientationDidChange, object: nil)
+    NotificationCenter.default.addObserver(self, selector: #selector(willChangeStatusBarFrame(_:)), name: .UIApplicationWillChangeStatusBarFrame, object: nil)
   }
   
   @objc private func bringToFront() {

    case .right: x = rate * (superview!.bounds.width * centerEdgeDistance - PictureInPicture.margin)
    }
    switch corner.verticalEdge {
    case .top:    y = rate * (-superview!.bounds.height * centerEdgeDistance + PictureInPicture.margin)
    case .bottom: y = rate * (superview!.bounds.height * centerEdgeDistance - PictureInPicture.margin)
    }
    center = CGPoint(x: x + translate.x + superview!.bounds.width / 2, y: y + translate.y + superview!.bounds.height / 2)

  }
  
  private var isPanVectorVertical = true
  private var isPanning = false
  
  private func panChanged(_ sender: UIPanGestureRecognizer) {
    if isLargeState || !PictureInPicture.movable {
