YI Open API provides mobile SDKs and reference designs for software developers and hardware makers to build cool apps and products with YI 4K Action Cameras
I would like to add a button in my app that can download the video just filmed. I use that code, but something is missing as it stops (it works perfectly for the little one or 2 seconds videos.
@IBAction func onSavingBtnClicked(_ sender: Any) {
let path = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]
let originPath = path.appending("/\(lastFileName)")
var test:Int = 0
let alert = UIAlertView();
alert.message = "Saving: \(lastFileName)";
alert.addButton(withTitle: "Ok")
alert.show()
self.mCamera.downloadFile(fileName: lastFileName, destFilePath: originPath, success:
{
downloadTask in
self.testLbl.text = String(describing: downloadTask.downloadedBytes)
} , fail: {
error in
let alert = UIAlertView();
alert.message = error as? String;
alert.addButton(withTitle: "Ko")
alert.show()
});
}
}
Should I have to use URLSession ? But I don't really know how to use it.
=> I don't know how to use that:
I would like to add a button in my app that can download the video just filmed. I use that code, but something is missing as it stops (it works perfectly for the little one or 2 seconds videos.
Should I have to use URLSession ? But I don't really know how to use it. => I don't know how to use that:
Thanks in advance.