Thanks @Justin Levi Winter answer, and I updated the code for Swift3 tested with Xcode 8 (This video plays in the timeline, but not on Quick Look):
import AVFoundation import PlaygroundSupport URLCache.shared = URLCache(memoryCapacity: 0, diskCapacity: 0, diskPath: nil) let width = 568 let height = 320 let container = UIView(frame: CGRect(x: 0, y: 0, width: width, height: height)) PlaygroundPage.current.liveView = container PlaygroundPage.current.needsIndefiniteExecution = true func playVideo(_ url: URL){ let f=CGRect(x: 0, y: 0, width: width, height: height) let playerItem = AVPlayerItem(url: url) let player=AVPlayer(playerItem: playerItem) let playerLayer=AVPlayerLayer(player: player) playerLayer.frame=f container.layer.addSublayer(playerLayer) PlaygroundPage.current.liveView = container player.play() } playVideo(URL(string:"http://s3.amazonaws.com/vids4project/sample.mp4")!)
source share