     }
 
     override var frame: NSRect {
-        didSet { updateCurrentTimeBar() }
+        didSet { updateCurrentTime() }
     }
 
-    private func updateCurrentTimeBar() {
-        if let p = currentTimePercent {
-            currentTimeBar.hidden = false
-            currentTimeBar.frame = NSRect(x: p * bounds.width, y: 0, width: 1, height: bounds.height)
+    private func updateCurrentTime() {
+        if  let item = player?.currentItem,
+            let time = currentTime {
+                let duration = item.duration
+                let p = CGFloat(time.convertScale(duration.timescale, method: CMTimeRoundingMethod.Default).value)
+                    / CGFloat(duration.value)
+                currentTimeBar.hidden = false
+                currentTimeBar.frame = NSRect(x: p * bounds.width, y: 0, width: 1, height: bounds.height)
+                currentTimeLabel.stringValue = time.stringInmmssSS
         } else {
             currentTimeBar.hidden = true
+            currentTimeLabel.stringValue = "--:--.--"
         }
     }
 

        }
    }
    var playerTimeObserver: AnyObject?
    var currentTimePercent: CGFloat? {
        didSet { updateCurrentTimeBar() }
    }
    private lazy var currentTimeBar: NSView = NSView(frame: NSZeroRect) ※ { v in
        v.wantsLayer = true
        v.layer?.backgroundColor = NSColor.redColor().CGColor
        self.addSubview(v)
    }
    var imageGenerator: AVAssetImageGenerator?
    var numberOfPages: UInt = 0 {
        didSet { setNeedsDisplayInRect(bounds) }

            player?.removeTimeObserver(playerTimeObserver)
        }

        playerTimeObserver = player?.addPeriodicTimeObserverForInterval(CMTime(value: 1, timescale: 30), queue: dispatch_get_main_queue()) { [weak self] time in
            self?.currentTime = time
        }
    }

