         
         topMaskView.snp.makeConstraints { (make) in
             make.top.left.right.equalTo(mainMaskView)
-            make.height.equalTo(65)
+        }
+        
+        topWrapperView.snp.makeConstraints { (make) in
+            make.height.equalTo(50)
+            
+            if #available(iOS 11.0, *) {
+                make.top.left.right.equalTo(topMaskView.safeAreaLayoutGuide)
+                make.bottom.equalToSuperview()
+            } else {
+                make.top.equalToSuperview().offset(15)
+                make.bottom.left.right.equalToSuperview()
+            }
         }
         
         bottomMaskView.snp.makeConstraints { (make) in
             make.bottom.left.right.equalTo(mainMaskView)
+        }
+        
+        bottomWrapperView.snp.makeConstraints { (make) in
             make.height.equalTo(50)
+            
+            if #available(iOS 11.0, *) {
+                make.bottom.left.right.equalTo(bottomMaskView.safeAreaLayoutGuide)
+                make.top.equalToSuperview()
+            } else {
+                make.edges.equalToSuperview()
+            }
         }
         
         // Top views
         backButton.snp.makeConstraints { (make) in
             make.width.height.equalTo(50)
-            make.left.bottom.equalTo(topMaskView)
+            make.left.bottom.equalToSuperview()
         }
         
         titleLabel.snp.makeConstraints { (make) in

        playButton.snp.makeConstraints { (make) in
            make.width.equalTo(50)
            make.height.equalTo(50)
            make.left.bottom.equalTo(bottomMaskView)
        }
        
        currentTimeLabel.snp.makeConstraints { (make) in

        mainMaskView.backgroundColor = UIColor(white: 0, alpha: 0.4 )
        
        // Top views
        topMaskView.addSubview(topWrapperView)
        topWrapperView.addSubview(backButton)
        topWrapperView.addSubview(titleLabel)
        topWrapperView.addSubview(chooseDefinitionView)
        
        backButton.tag = BMPlayerControlView.ButtonType.back.rawValue
        backButton.setImage(BMImageResourcePath("Pod_Asset_BMPlayer_back"), for: .normal)
