         setupMaxResolution(for: playerLayer.frame.size)
     }
 
+    private func handleStatusChangedEvent(player: AVPlayer, changes: Any) {
+        guard let currentItem = player.currentItem, playerStatus != currentItem.status else { return }
+        playerStatus = currentItem.status
+
+        if isReadyToPlay && state != .paused {
+            readyToPlay()
+        } else if playerStatus == .failed, let error = currentItem.error {
+            trigger(.error, userInfo: ["error": error])
+            Logger.logError("playback failed with error: \(error.localizedDescription) ", scope: pluginName)
+        }
+    }
+
     private func didFinishedItem(from notification: NSNotification?) -> Bool {
         guard let object = notification?.object as? AVPlayerItem,
             let item = player?.currentItem,

        }
    }


    private func handlePlayerRateChanged() {
        if player?.rate == 0 && playerStatus != .unknown && state != .idle {
            updateState(.paused)

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

    private var kvoLoadedTimeRangesContext = 0
    private var kvoSeekableTimeRangesContext = 0
    private var kvoBufferingContext = 0
