Android Example DJI app java object to start video recording

This starts recording video with your dji app

B4X:
'put this in process globals

   Dim AircraftInstance As JavaObject
  

    Dim CameraInstance As JavaObject


'Put this in AfterAircraftConnected

    AircraftInstance=aircraft
   
    CameraInstance=AircraftInstance.RunMethod("getCamera", Null)



B4X:
Sub StartRecordingVideo
   
    Dim cc As Object
     cc= CameraInstance.CreateEventFromUI("dji.common.util.CommonCallbacks$CompletionCallback", "callback", Null)
    CameraInstance.RunMethod("startRecordVideo", Array( cc))
   
   
Wait For (CameraInstance) Callback_Event (MethodName As String, Args() As Object)
If Args(0) = Null Then
    Labelssc.Text="Recording"
    
Else
    Labelssc.Text="Failed to start recording: " & Args(0)
        
End If


End Sub



Labelssc is just a label I use for debugging. I tested this on Mavic and it works
 
Top