                     qualityIsBeingChanged = true
                     player?.replaceCurrentItemWithPlayerItem(item)
                     if let cip = cip {
-                        seekToTime(cip)
+                        //We can't call self.seekToTime in here since the player is loading a new
+                        //item and `cip` is probably not in the seekableTimeRanges.
+                        player?.seekToTime(CMTime(seconds: cip, preferredTimescale: 1000000000))
                     }
                     qualityIsBeingChanged = false
 


                currentItem = ci
                if let cip = cip {
                    seekToTime(cip)
                }

                retryCount++

                    qualityIsBeingChanged = true
                    player?.replaceCurrentItemWithPlayerItem(item)
                    if let cip = cip {
                        //We can't call self.seekToTime in here since the player is loading a new
                        //item and `cip` is probably not in the seekableTimeRanges.
                        player?.seekToTime(CMTime(seconds: cip, preferredTimescale: 1000000000))
                    }
                    qualityIsBeingChanged = false

