Skip to content

Instantly share code, notes, and snippets.

@pgpt10
Created February 21, 2019 11:43
Show Gist options
  • Save pgpt10/aaed8235019a0c57b634b659823e6829 to your computer and use it in GitHub Desktop.
Save pgpt10/aaed8235019a0c57b634b659823e6829 to your computer and use it in GitHub Desktop.
let urls = [URL]()
//Add items to urls array
var playerItems = [AVPlayerItem]()
urls.forEach { (url) in
let asset = AVAsset(url: url)
let playerItem = AVPlayerItem(asset: asset)
playerItems.append(playerItem)
}
let player = AVQueuePlayer(items: playerItems)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment