【发布时间】:2016-09-15 11:17:27
【问题描述】:
我尝试使用Alamofire 下载文件,并且取得了进展。我现在要做的是从视频 URL 构建一种本地流。
Alamofire 将下载的文件存储在目标位置。
let destination = Alamofire.Request.suggestedDownloadDestination(directory: .DocumentDirectory, domain: .LocalDomainMask)
在我的情况下,此目的地无效。例如。
if totalBytesRead >= 51831 {
let player = AVPlayer(URL: NSURL(fileURLWithPath: "\(destination)"))
let playerController = AVPlayerViewController()
playerController.player = player
self.presentViewController(playerController, animated: true) {
player.play()
}
}
还有其他方法吗?或者我可以将下载的字节存储到数组/缓冲区吗?
谢谢
【问题讨论】:
标签: ios swift avplayer alamofire