public class

DJIMediaManager

extends Object
java.lang.Object
   ↳ dji.sdk.Camera.DJIMediaManager

Class Overview

The media manager is used to interact with the file system in the SD card. By using the manager, user can get the meta data for all the multimedia files and access to each single multimedia file.

Summary

Nested Classes
interface DJIMediaManager.CameraDownloadListener<E> This callback will notify the app when the media download executed. 
Public Methods
void continueDownloading()
Continues downloading.
void deleteMedia(ArrayList<DJIMedia> toDeleteMediaFiles, DJICompletionCallbackWithTwoParam<ArrayList<DJIMedia>, DJICameraError> callback)
Delete media from remote album.
void exitMediaDownloading()
This will entirely stop the downloading process and of course clean the downloading thread pool.
void fetchMediaList(CameraDownloadListener<ArrayList<DJIMedia>> callback)
Fetches media list from remote album.
void pauseDownloading()
Shuts down the downloading process immediately.
void setCameraModeMediaDownload(DJIBaseComponent.DJICompletionCallback callback)
This method will be used to set the camera work mode to MediaDownload mode for DJIMedia.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public void continueDownloading ()

Continues downloading. The downloading threads are put into a single thread pool. This function will continue the download process and starting from downloading requests in the not-started execution list.


Precondition:
Developers invoke the function of pauseDownloading().


Post Condition:
After this function invoked, the thread pool will continue to execute the downloading request.

public void deleteMedia (ArrayList<DJIMedia> toDeleteMediaFiles, DJICompletionCallbackWithTwoParam<ArrayList<DJIMedia>, DJICameraError> callback)

Delete media from remote album. At most 255 media files can be deleted once. The recommended media files to delete at the same time is around 20.

Precondition:
The camera work mode is MediaDownload mode.

Post Condition:
This method will delete the media files based on the DJIMedia arraylist.

Parameters
toDeleteMediaFiles Media files to be deleted, at most 255 media files once.
callback This callback will return an arraylist which will contain the undeleted DJIMedia files and a DJIError for notifying developers whether the method has been executed successfully.

public void exitMediaDownloading ()

This will entirely stop the downloading process and of course clean the downloading thread pool. The camera will exit the MediaDownload mode and enter the TAKEPHOTO mode.

Precondition:
The camera enters the MediaDownload mode.


Post Condition:
After this function invoked, the camera mode will shift to TAKEPHOTO mode.

public void fetchMediaList (CameraDownloadListener<ArrayList<DJIMedia>> callback)

Fetches media list from remote album.

Precondition:
The camera work mode is MediaDownload mode.

Post Condition:
This method will request the media list which will show the content on the SD card. The content includes videos, images.

Parameters
callback - CameraDownloadListener listens to how the download progress. It requires the developer to implement five methods. The details of the five methods are as follows:

onStart(): called once the download process starts.
onRateUpdate(): called to update the downloading rate.
onProgress(): called to update the downloading progress.
onSuccess(): called once the download is finished.
onFailure(): called once an error occurs.
Returns
  • No output parameters

public void pauseDownloading ()

Shuts down the downloading process immediately. It will not wait for the actively downloading request to terminate. This method will shut down the download process BUT it will not entirely stop the downloading process. Once the developer invokes ContinueDownloading, the process will continue to starting from the un-commenced downloading request.

Precondition:
The camera is fetching data from the SDCard in the camera back to SDK.


Post Condition:
After this function invoked, the downloading process will shut down temporarily.

public void setCameraModeMediaDownload (DJIBaseComponent.DJICompletionCallback callback)

This method will be used to set the camera work mode to MediaDownload mode for DJIMedia. We recommend developers to use this API to set the MediaDownload mode for Media related functions.


Post Condition:
1. After this function invoked, the camera mode will shift to MediaDownload mode.
2. The developer could fetch the media list and then the media thumbnail, full screen thumbnail and the full image or video.

Parameters
callback The execution callback with the execution result returned.
Returns
  • void