и сохранить файл mp4 в галерее в Swift 3.0.
Я попробовал следующее код,
Код: Выделить всё
func setupAssetDownload(url:URL) {
//
let configuration = URLSessionConfiguration.background(withIdentifier: "streamVideo")
let downloadSession = AVAssetDownloadURLSession(configuration: configuration,
assetDownloadDelegate: self,
delegateQueue: OperationQueue.main)
let asset = AVURLAsset(url: url)
let downloadTask = downloadSession.makeAssetDownloadTask(asset: asset,
assetTitle: "",
assetArtworkData: nil,
options: nil)
downloadTask?.resume()
}
Код: Выделить всё
func urlSession(_ session: URLSession, assetDownloadTask: AVAssetDownloadTask, didFinishDownloadingTo location: URL) {
}
Подробнее здесь: https://stackoverflow.com/questions/470 ... deo-to-mp4