[英]The file “IMG_00001.MOV” couldn’t be opened because you don’t have permission to view it
When try convert video url to data then getting error: 尝试将视频网址转换为数据时出现错误:
"The file “IMG_00001.MOV” couldn’t be opened because you don’t have permission to view it."
Here is my code: 这是我的代码:
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)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.