当尝试将视频 url 转换为数据时出现错误:
"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)
}
videoMainData?.write(to: vidUrl
尝试在之后添加此行。
videoMainData = videoData.base64EncodedString(options: Data.Base64EncodingOptions.endLineWithLineFeed)
关于ios - 文件 “IMG_00001.MOV” 无法打开,因为您无权查看它,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44777649/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) | Powered by Discuz! X3.4 |