             }
             let timeSec = videoStart + offset * (videoDuration ?? 1.0)
             let time = CMTimeMakeWithSeconds(Float64(timeSec), 600)
-            let tolerance = CMTimeMake(10, 600) // 1/60sec
             if player.status == AVPlayerStatus.readyToPlay {
                 self.fSeeking = true
                 SwipeElement.objectCount -= 1 // to avoid false memory leak detection

*/
    func handleVideoEnd(videoPlayer:AVPlayer) {
        if self.delegate != nil && self.delegate!.shouldRepeat(self) {
            videoPlayer.seek(to: CMTime(seconds:Double(videoStart), preferredTimescale: 600), toleranceBefore: kCMTimeZero, toleranceAfter: kCMTimeZero)
            videoPlayer.play()
        } else {
            self.fNeedRewind = true

    private var videoStart = CGFloat(0.0)
    private var videoDuration:CGFloat?
    private var hasObserver = false
    private let tolerance = CMTimeMake(10, 600) // 1/60sec

    // Sprite Element Specific
    private var spriteLayer:CALayer?
