Mobile-SDK-iOS icon indicating copy to clipboard operation
Mobile-SDK-iOS copied to clipboard

Mini 2 Swift no video feed

Open hdrpano opened this issue 2 years ago • 9 comments

As you know me I don't update issues but always solutions

The Mini 2 needs some modification in the swift SDK 4.16 version to show the video feed:

add this it the VideoPrewierAdapter

    } else if camera == DJICameraDisplayNameMavicMiniCamera {
        return ._MavicMini
    } else if camera == DJICameraDisplayNameDJIMini2Camera {
        return ._DJIMini2
    }

add this in the StartViewController

    self.adapter = VideoPreviewerAdapter.init()
    self.adapter?.start()
    adapter?.setupFrameControlHandler()

The DJI Mini 2 needs the setupFrameControlHandler()

hdrpano avatar Mar 15 '22 18:03 hdrpano

Agent comment from DJI SDK in Zendesk ticket #61586:

尊敬的开发者,感谢您联系DJI 大疆创新 由于github不是我们主要的咨询渠道,您的问题可能跟进不及时。我们建议您通过填写表单( https://djisdksupport.zendesk.com/hc/zh-cn/requests/new )向我们反馈问题。或者您也可以在论坛发帖,与其它开发者交流。论坛链接:https://djisdksupport.zendesk.com/hc/zh-cn/community/topics

Dear developer, thank you for contacting DJI. Since github is not our main consultation channel, your questions may not be followed up in time. We recommend that you fill in the form (https://djisdksupport.zendesk.com/hc/en-us/requests/new) to report problems to us. Or you can post in the forum to communicate with other developers. Forum link: https://djisdksupport.zendesk.com/hc/zh-cn/community/topics

°°°

dji-dev avatar Mar 15 '22 18:03 dji-dev

Thanks for this @hdrpano .

I was able to make the modifications and get it showing in the Mobile-SDK-iOS sample app.

However, I'm using DJI's UXSDK for iOS in my own app and I can't see the video feed in the DUXDefaultLayoutViewController. I updated the UXSDk to the latest version.

Is that something that DJI will need to update in the UXSDK before it starts working? I'll probably open an issue there if that's the case.

aero-jet avatar Mar 17 '22 03:03 aero-jet

We will update the iOS Swift demo soon.

DJI-William avatar Mar 21 '22 06:03 DJI-William

@aero-jet

Have you tried to set FrameControlHandler for default DJIVideoPreviewer when using DUXDefaultLayoutViewController?

So, something like that is required:

`let feed = DJISDKManager.videoFeeder()?.primaryVideoFeed

let previewer = DJIVideoPreviewer.instance() previewer?.frameControlHandler = self`

I would like to have support of Mini 2 in my app, but unfortunately, i don't have this model to test whether such approach works.

YaroTs avatar Mar 21 '22 09:03 YaroTs

I will test that for you.

Am 21.03.2022 um 10:08 schrieb Yaroslav Tsimokha @.***>:

 @aero-jet

Have you tried to set FrameControlHandler for default DJIVideoPreviewer when using DUXDefaultLayoutViewController?

So, something like that is required:

`let feed = DJISDKManager.videoFeeder()?.primaryVideoFeed

let previewer = DJIVideoPreviewer.instance() previewer?.frameControlHandler = self`

I would like to have support of Mini 2 in my app, but unfortunately, i don't have this model to test whether such approach works.

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.

hdrpano avatar Mar 21 '22 09:03 hdrpano

We will update the iOS Swift demo soon.

DUXFPVViewController also doesn't work with Mini 2. Will the UXSDK be updated?

lhuanyu avatar Mar 22 '22 08:03 lhuanyu

We will update the iOS Swift demo soon.

DUXFPVViewController also doesn't work with Mini 2. Will the UXSDK be updated?

Yes, we will update iOS UXSDK later.

DJI-William avatar Mar 22 '22 10:03 DJI-William

Thanks for this @hdrpano .

I was able to make the modifications and get it showing in the Mobile-SDK-iOS sample app.

However, I'm using DJI's UXSDK for iOS in my own app and I can't see the video feed in the DUXDefaultLayoutViewController. I updated the UXSDk to the latest version.

Is that something that DJI will need to update in the UXSDK before it starts working? I'll probably open an issue there if that's the case.

Because DJIUXSDK is actually using VideoPreviewerSDKAdapter from the demo. A possible solution is to swizzle the + (H264EncoderType)getDataSourceWithCameraName:(NSString *)cameraName andIsAircraft:(BOOL)isAircraft of VideoPreviewerSDKAdapter with:

+ (H264EncoderType)mini_getDataSourceWithCameraName:(NSString *)cameraName andIsAircraft:(BOOL)isAircraft {
    if([cameraName isEqualToString:DJICameraDisplayNameMavicMiniCamera]) {
        return H264EncoderType_MavicMini;
    }
    else if ([cameraName isEqualToString:DJICameraDisplayNameDJIMini2Camera]) {
        return H264EncoderType_DJIMini2;
    }
    
    return [self mini_getDataSourceWithCameraName:cameraName andIsAircraft:isAircraft];
}

lhuanyu avatar Mar 31 '22 05:03 lhuanyu

DJI needs to update the UXSDK before it works with the Mini 2. The video feed and the set camera mode won‘t work with the actual version.

Am 17.03.2022 um 04:40 schrieb Jeffrey Leung @.***>:

 Thanks for this @hdrpano .

I was able to make the modifications and get it showing in the Mobile-SDK-iOS sample app.

However, I'm using DJI's UXSDK for iOS in my own app and I can't see the video feed in the DUXDefaultLayoutViewController. I updated the UXSDk to the latest version.

Is that something that DJI will need to update in the UXSDK before it starts working? I'll probably open an issue there if that's the case.

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.

hdrpano avatar Oct 11 '22 07:10 hdrpano