             .addDisposableTo(_disposeBag)
     }
 
+    @objc
+    private func didEndPlay(_ notification: Foundation.Notification) {
+        assert(Thread.isMainThread)
+
+        if let item = notification.object as? AVPlayerItem, let trackId = item.trackId {
+            _installs.forEach { $0.didEndPlayTrack(trackId) }
+        }
+        if _player.items().count == 1 {
+            pause()
+        }
+    }
+}
+
+// add/(remove)
+extension PlayerImpl {
 
     func add(track: Track) {
         add(track: track, afterPlaylist: false)

            )
            .addDisposableTo(disposeBag)
    }

    @objc
    private func didEndPlay(_ notification: Foundation.Notification) {
        assert(Thread.isMainThread)

        if let item = notification.object as? AVPlayerItem, let trackId = item.trackId {
            _installs.forEach { $0.didEndPlayTrack(trackId) }
        }
        if _player.items().count == 1 {
            pause()
        }
    }
}

private func configureFading(item: AVPlayerItem, duration: Double) {


    func nextTrack() { _player.advanceToNextItem() }

}

// control queueing
extension PlayerImpl {

    fileprivate func updateQueue() {

        print("caller updateQueue")
        if _playingQueue.isEmpty { return }
