How to make the Mavic 2 Pro - Hardware photo buttons work in the ...
1715 4 2020-5-12
Uploading and Loding Picture ...(0/1)
o(^-^)o
DJI_Zoe
lvl.1

United States
Offline

When the SDK support for the Mavic 2 platform was released, developers often wondered what happened with the remote controller buttons to "Take Photo" and "Take Video".  The answer was in the 4.8 Release Notes:
"The implementation of shoot photo button and record video button in MSDK have been removed,
developers need to implement their own function by listening to the press events of Remote Controller
for Mavic Pro and Mavic 2 platforms."


Hope this helps clear up the mystery!

-Zoe
QA Engineer, US R&D
2020-5-12
Use props
MitchRSM
lvl.4
Flight distance : 149534 ft
  • >>>
San Marino
Offline

yes, but later in SDK 4.11 was no more need to listening to the press events of Remote Controller cause was added set/getShutterButtonBindingEnabledWithCompletion: and set/getRecordButtonBindingEnabledWithCompletion: both enabled by default
2020-5-12
Use props
hdrpano
lvl.4
Flight distance : 598458 ft
  • >>>
Switzerland
Offline

Swift 5, iOS

I solved the issue with an extension. You can control the RC Hardware State. Use that only for Mavic 2 models. I added the iOS camera sound when we trigger the shootPhoto function.  

extension ViewController: DJIRemoteControllerDelegate {
   
    func remoteController(_ remoteController: DJIRemoteController, didUpdate  state: DJIRCHardwareState) {
        if state.shutterButton.isClicked.boolValue {
            print("Shutter button clicked")
         
            if self.aircraftModel == DJIAircraftModelNameMavic2Enterprise || self.aircraftModel == DJIAircraftModelNameMavic2Pro || self.aircraftModel == DJIAircraftModelNameMavic2Zoom {
                self.shootPhoto()
                AudioServicesPlaySystemSound(SystemSoundID(1108))
            }
        }
    }
}
2020-5-13
Use props
Fish in Water
lvl.2
Flight distance : 541512 ft
China
Offline

That is a good question!
2020-6-2
Use props
djiuser_dPVFlzbbXexg
lvl.2
Japan
Offline


Please help me, I need to use the same function but it's never being called. please note that I am using the DJI Mavic 2 Pro and running it on the simulator! What I am missing here?

func remoteController(_ remoteController: DJIRemoteController, didUpdate  state: DJIRCHardwareState) {
        if state.shutterButton.isClicked.boolValue {
            print("Shutter button clicked")
    }
}
2020-11-26
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules