繁体   English   中英

由于您无权查看文件“ IMG_00001.MOV”,因此无法打开

[英]The file “IMG_00001.MOV” couldn’t be opened because you don’t have permission to view it

尝试将视频网址转换为数据时出现错误:

"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)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM