                             let coundDownTime = Double(Int((durationSeconds - currentSeconds) * 10)) / 10
                             self.mediaControlView.timeLabel.text = "\(coundDownTime)"
                         })
+
+                        NSNotificationCenter.defaultCenter().addObserver(self, selector: "playerItemDidReachEnd:", name: AVPlayerItemDidPlayToEndTimeNotification, object: player.currentItem)
 
                         mediaView.videoPlayerLayer.player = player
 


    @IBOutlet weak var mediaControlView: MediaControlView!

    
    override func viewDidLoad() {
        super.viewDidLoad()

            }
        }
    }

    func playerItemDidReachEnd(notification: NSNotification) {
        mediaControlView.playState = .Pause
    }
}
