             player.observe(\.currentItem?.status, options: .new, changeHandler: handleStatusChangedEvent),
             player.observe(\.currentItem?.loadedTimeRanges, options: .new, changeHandler: handleLoadedTimeRangesEvent),
             player.observe(\.currentItem?.seekableTimeRanges, options: .new, changeHandler: handleSeekableTimeRangesEvent),
+            player.observe(\.currentItem?.isPlaybackLikelyToKeepUp, options: .new, changeHandler: handlePlaybackLikelyToKeepUp),
+            player.observe(\.currentItem?.isPlaybackBufferEmpty, options: .new, changeHandler: handlePlaybackBufferEmpty),
             player.observe(\.isExternalPlaybackActive, options: .new, changeHandler: handleExternalPlaybackActiveEvent),
             player.observe(\.rate, options: .new, changeHandler: handlePlayerRateChanged),
         ]
-
-        player.addObserver(self, forKeyPath: "currentItem.playbackLikelyToKeepUp",
-                            options: .new, context: &kvoBufferingContext)
-        player.addObserver(self, forKeyPath: "currentItem.playbackBufferEmpty",
-                            options: .new, context: &kvoBufferingContext)
 
         NotificationCenter.default.addObserver(
             self,
             selector: #selector(AVFoundationPlayback.playbackDidEnd),
             name: NSNotification.Name.AVPlayerItemDidPlayToEndTime,
             object: player.currentItem)
+    }
+
+    private var hasEnoughBufferToPlay: Bool {
+        return player?.currentItem?.isPlaybackLikelyToKeepUp == true && state == .stalling
+    }
+
+    private func handlePlaybackLikelyToKeepUp(player: AVPlayer, changes: Any) {
+        guard state != .paused else { return }
+
+        if hasEnoughBufferToPlay {
+            play()
+            selectDefaultSubtitleIfNeeded()
+        } else {
+            updateState(.stalling)
+        }
+    }
+
+    private func handlePlaybackBufferEmpty(player: AVPlayer, changes: Any) {
+        guard state != .paused else { return }
+        updateState(.stalling)
     }
 
     private func maximizePlayer(view: UIView, changes: NSKeyValueObservedChange<CGRect>) {

        "mp4": "video/mp4",
        "m3u8": "application/x-mpegurl",
    ]

    private var kvoBufferingContext = 0

    private(set) var seekToTimeWhenReadyToPlay: TimeInterval?
    

        }
    }

    @objc internal func seekOnReadyIfNeeded() {
        if let timeToSeek = seekToTimeWhenReadyToPlay {
            seek(timeToSeek)
