簡體   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