I had the same problem, but I got a solution.
You must play after the player status has changed to .ReadyToPlay.
I also answered here , this problem is similar to your problem.
See below.
func startVideoPlayer() { let playerItem = AVPlayerItem(asset: self.composition!) playerItem.videoComposition = self.videoComposition! let player = AVPlayer(playerItem: playerItem) player.actionAtItemEnd = .None videoPlayerLayer = AVPlayerLayer(player: player) videoPlayerLayer!.frame = self.bounds player.addObserver(self, forKeyPath: "player.currentItem.status", options: .New, context: nil) NSNotificationCenter.defaultCenter().addObserver(self, selector: "playerItemDidReachEnd:", name: AVPlayerItemDidPlayToEndTimeNotification, object: playerItem); self.layer.addSublayer(videoPlayerLayer!) } override func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutablePointer<Void>) { if keyPath != nil && keyPath! == "player.currentItem.status" { if let newValue = change?[NSKeyValueChangeNewKey] { if AVPlayerStatus(rawValue: newValue as! Int) == .ReadyToPlay { playVideo() } } } else { super.observeValueForKeyPath(keyPath, ofObject: object, change: change, context: context) } } func playerItemDidReachEnd(notification: NSNotification) { let playerItem = notification.object as! AVPlayerItem playerItem.seekToTime(kCMTimeZero) playVideo() } func playVideo() { videoPlayerLayer?.player!.play() }
source share