         }
     }
 
-    private func updatePlaylistQueue() {
+    fileprivate func updatePlaylistQueue() {
         if _playlists.isEmpty { updateQueue(); return }
         if _playingQueue.count > 2 { updateQueue(); return }
         if _player.items().count > 2 { return }

            )
            .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) {

    private(set) lazy var currentTime: Observable<Float64> = asObservable(self._currentTime)
    private let _currentTime = Variable<Float64>(0)

    fileprivate var _installs: [PlayerMiddleware] = []

    var playing: Bool { return _player.rate != 0 }

    fileprivate let previewer: Preview

    init(previewer: Preview) {
        self.previewer = previewer
