         }
     }
 
-    private func handleExternalPlaybackActiveEvent() {
-        guard let isExternalPlaybackActive = player?.isExternalPlaybackActive else { return }
-
-        if isExternalPlaybackActive {
-            enableBackgroundSession()
-        } else {
-            restoreBackgroundSession()
-        }
-        trigger(.didUpdateAirPlayStatus, userInfo: ["externalPlaybackActive": isExternalPlaybackActive])
-    }
-
     func handleDvrAvailabilityChange() {
         if lastDvrAvailability != isDvrAvailable {
             trigger(.didChangeDvrAvailability, userInfo: ["available": isDvrAvailable])

            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.addObserver(self, forKeyPath: "currentItem.playbackLikelyToKeepUp",
                            options: .new, context: &kvoBufferingContext)
        player.addObserver(self, forKeyPath: "currentItem.playbackBufferEmpty",
                            options: .new, context: &kvoBufferingContext)
        player.addObserver(self, forKeyPath: "externalPlaybackActive",
                            options: .new, context: &kvoExternalPlaybackActiveContext)
        player.addObserver(self, forKeyPath: "rate",
                            options: .new, context: &kvoPlayerRateContext)


        }
    }

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