尝试将视频网址转换为数据然后收到错误:
"The file “IMG_00001.MOV” couldn’t be opened because you don’t have permission to view it."
这是我的代码:
let videoUrl = Dictionary.object(forKey: "videoUrl") as! String
do {
let vidUrl = URL(fileURLWithPath: videoUrl)
let videoData = try Data.init(contentsOf: vidUrl)
videoMainData = videoData.base64EncodedString(options: Data.Base64EncodingOptions.endLineWithLineFeed)
} catch let error as NSError {
print(error.localizedDescription)
}
答案 0 :(得分:0)
videoMainData?.write(to: vidUrl
尝试添加此行后..
videoMainData = videoData.base64EncodedString(options: Data.Base64EncodingOptions.endLineWithLineFeed)