if let cloudflareModel = cloudflareModel {
if let secureURL = URL(string: cloudflareModel.location) {
SVProgressHUD.show(withStatus: "Loading...")
do {
let client = try TUSClient(server: secureURL)
let uploadObject = try client.uploadFileAt(filePath: url,context: [
"name": fileName,
"filename": fileName,
"filetype": "video/\(url.pathExtension)"
])
client.delegate = observer
client.start()
}catch{
DispatchQueue.main.async {
Message.show(.error, "Error uploading video")
}
}