         fatalError("init(context:) has not been implemented")
     }
 
-    open override func layoutSubviews() {
-        if let playerLayer = playerLayer {
-            playerLayer.frame = self.bounds
-        }
+    open func handleViewBoundsChanged() {
+        guard let playerLayer = playerLayer else {
+            return
+        }
+        playerLayer.frame = view.bounds
+        setupMaxResolution(for: playerLayer.frame.size)
     }
 
     open override func play() {

        didSet {
            switch currentState {
            case .buffering:
                accessibilityIdentifier = "AVFoundationPlaybackBuffering"
            case .paused:
                accessibilityIdentifier = "AVFoundationPlaybackPaused"
            case .playing:
                accessibilityIdentifier = "AVFoundationPlaybackPlaying"
            case .idle:
                accessibilityIdentifier = "AVFoundationPlaybackIdle"
            }
        }
    }

                player?.removeTimeObserver(timeObserver)
            }
        }
        view.removeObserver(self, forKeyPath: "bounds")
        NotificationCenter.default.removeObserver(self)
    }

