DragonX-cloud / dji_flutter_plugin

A Flutter plugin for DJI SDK.
BSD 3-Clause "New" or "Revised" License
34 stars 8 forks source link

Medialist #18

Closed ktan0044 closed 1 year ago

ktan0044 commented 1 year ago

Hi, why does the getMediaList function returns an empty list of media but in the dji plugin android log, it shows that a few files has been added

[dji.flutter] Get Media List requested [dji.flutter] Media List: [] D/=== DjiPlugin Android(25092): Get media list started D/=== DjiPlugin Android(25092): Get media list successful D/=== DjiPlugin Android(25092): Get media list - added file DJI_0003.mp4 D/=== DjiPlugin Android(25092): Get media list - added file DJI_0004.mp4 D/=== DjiPlugin Android(25092): Get media list - added file DJI_0005.mp4 D/=== DjiPlugin Android(25092): Get media list - added file DJI_0006.mp4

orenagiv commented 1 year ago

Hey @ktan0044 That's interesting 🤔

I'll check ASAP.

ktan0044 commented 1 year ago

Hey @ktan0044 That's interesting 🤔

I'll check ASAP.

Hi is there any update related to this ? And may i know how should i add action such as START_TAKE_PHOTO { 'location': { 'latitude': remainingWaypoint[i].latitude, 'longitude': remainingWaypoint[i].longitude, 'altitude': 10, }, 'waypointActions': ["START_TAKE_PHOTO"], 'heading': 0, 'gimbalPitch': null, 'cornerRadiusInMeters': 1, 'turnMode': 'counterClockwise', }

Is it like this ?

orenagiv commented 1 year ago

Hey @ktan0044

It seems the getMediaList() works, but returns an immediate response, instead of waiting for the native platform to return the list. I'll look into this and resolve once I can.

But the 'status' object does get updated correctly with the "Got Media List" status once the process is complete. And at that point - the native platform has the list of media files, which allows you to use the Dji.downloadMedia() method to download the media you wish (by indicating the 'index').

In regards to the taking a photo or start/stop video - that can be done as part of the timeline list of the Dji.start() method:

Flight flight = Flight.fromJson({
    'timeline': [
        {
            'type': 'takeOff',
        },
        {
            'type': 'startRecordVideo',
        },
        ...

The available types appear in the Readme: https://github.com/DragonX-cloud/dji_flutter_plugin, under the DJI.strart() method:

A Flight Element has several types:
- takeOff
- land
- waypointMission
- singleShootPhoto
- startRecordVideo
- stopRecordVideo

Hope this helps 🙏

ktan0044 commented 1 year ago

Hey @ktan0044

It seems the getMediaList() works, but returns an immediate response, instead of waiting for the native platform to return the list. I'll look into this and resolve once I can.

But the 'status' object does get updated correctly with the "Got Media List" status once the process is complete. And at that point - the native platform has the list of media files, which allows you to use the Dji.downloadMedia() method to download the media you wish (by indicating the 'index').

In regards to the taking a photo or start/stop video - that can be done as part of the timeline list of the Dji.start() method:

Flight flight = Flight.fromJson({
    'timeline': [
        {
            'type': 'takeOff',
        },
        {
            'type': 'startRecordVideo',
        },
        ...

The available types appear in the Readme: https://github.com/DragonX-cloud/dji_flutter_plugin, under the DJI.strart() method:

A Flight Element has several types:
- takeOff
- land
- waypointMission
- singleShootPhoto
- startRecordVideo
- stopRecordVideo

Hope this helps 🙏

Thank you so much for the media list update, as for the starting mission I found out that for now its only possible to do it via multiple waypoint missions method. Thank you

orenagiv commented 1 year ago

Hey @ktan0044 Yes - if you want to do multiple start/stops of a video - then you need multiple waypoint missions. But you could also simply start before one-long-waypoint-mission and stop afterwards, and then use FFMPEG to split the video as you wish.

I'm closing this issue for now (please open a new one if you need anything else).