let url:NSURL = NSURL(string: jsonSession[indexPath.row].link)!
let player = AVPlayer(URL: url)
player.allowsExternalPlayback = true
player.usesExternalPlaybackWhileExternalScreenIsActive = true
let playerViewController = AVPlayerViewController()
playerViewController.player = player
self.presentViewController(playerViewController, animated: true) {
playerViewController.player!.play()
}
this is my code and i try to recommend if a playback end, to play the next movie :-)