Я не могу загрузить файлы фильмов в хранилище Firebase с текущим кодом.Я вижу загруженные видео-файлы при сохранении их в каталог «temp» через NSTevenDirectory.Файлы фильмов также будут отображаться как загруженные через обозреватель, но я не вижу их в хранилище Firebase.Может кто-нибудь, пожалуйста, помогите мне?
let storageReference : StorageReference = {
return Storage.storage().reference(forURL: "gs://greenwealth-302e0.appspot.com/").child("myVideos")
}()
@IBAction func recordingBtn(_ sender: UIButton) {
if movieFileOutput.isRecording{
movieFileOutput.stopRecording()
//Upload video to firestorage
let udloadRef = storageReference.child("showMe.mov")
let uploadVideoTask = udloadRef.putFile(from: URL(fileURLWithPath: self.videoLocation()))
uploadVideoTask.observe(.progress) { (snapshot) in
print(snapshot.progress ?? "Progress cancelled")
}
uploadVideoTask.resume()
}
else{
//Start recoding
movieFileOutput.connection(with: .video)?.videoOrientation = self.videoOrientation()
movieFileOutput.maxRecordedDuration = maxRecordedDuration()
movieFileOutput.startRecording(to: URL(fileURLWithPath: self.videoLocation()), recordingDelegate: self)
}
}
func videoLocation() -> String{
let temporaryURL = NSTemporaryDirectory().appending("showMe.mov")
return temporaryURL
}