djiuser_LqiBEGU2pd8u
lvl.1
Netherlands
Offline
|
MeteC Posted at 2021-3-24 05:46
From my DJI Developer Support ticket for the same issue:
For the Mavic Air 2 drone, should use the setFlatMode to switch the photo, video mode, and use the enterPlayback, exitPlayback to enter/ exit the download mode.
Hello, I would like to know if I can after enterPlayback mode, use fetchData() my following code is:
func camera(_ camera: DJICamera, didGenerateNewMediaFile newMedia: DJIMediaFile) {
camera.enterPlayback()
newMedia.fetchData(withOffset: 0, update: DispatchQueue.main, update: { [self](_ data: Data?, _ isComplete: Bool, _ error: Error?) -> Void in
if error != nil {
testlabel.text = "\(error!.localizedDescription)"
print("State:")
print("Error downloading photo: \(error!)")
}
else {
// unwrap downloaded data and create image
guard let data = data else {return}
let downloadedImage = UIImage(data: data)
pictureview.image = downloadedImage
}
guard isComplete else {return}
camera.exitPlayback()
})
This is not working it says camera is busy or the command is not supported in the camera's current state. |
|