class MediaManager implements DJIParamAccessListener |
Package: | dji.sdk.media |
The media manager is used to interact with the file system on the SD card or the internal storage. By using the media manager, the user can get the metadata for all the multimedia files, and has access to each individual multimedia file.
void addMediaUpdatedVideoPlaybackStateListener(VideoPlaybackStateListener callback) |
Package: | dji.sdk.media |
Sets the callback object for updating the video playback state of the media manager.
VideoPlaybackStateListener callback | callback object of updating the vision detection state. |
FetchMediaTaskScheduler getScheduler() |
Package: | dji.sdk.media |
Fetch media task scheduler. This can be used to queue the download of the previews, thumbnails and XML custom data from multiple media files.
FetchMediaTaskScheduler | An object of FetchMediaTaskScheduler . |
|
Package: | dji.sdk.media |
The file list state of the SD card.
FileListState | An enum value of FileListState . |
|
Package: | dji.sdk.media |
Returns a copy of the current file list on the SD card after you call refreshFileListOfStorageLocation
. Returns null
if getSDCardFileListState
is reset.
List<MediaFile> | An array of MediaFile objects. |
|
Package: | dji.sdk.media |
The file list state of the internal storage.
FileListState | An enum value of FileListState . |
|
Package: | dji.sdk.media |
Returns a copy of the current file list on the internal storage after you call refreshFileListOfStorageLocation
. Returns nil
if getInternalStorageFileListState
is reset or unknown.
List<MediaFile> | An array of MediaFile objects. |
void refreshFileListOfStorageLocation(SettingsDefinitions.StorageLocation storageLocation, |
Package: | dji.sdk.media |
Refreshes the file list of the storage. If the current state is RESET
, the media manager will try to fetch the complete file list. If the current state is INCOMPLETE
, the media manager will only fetch the missing list of files. If the file list is refreshed successfully, the corresponding file list state (either getSDCardFileListState
or getInternalStorageFileListState
) will become UP_TO_DATE
.
SettingsDefinitions.StorageLocation storageLocation | The storage location of the file list to refresh. |
CompletionCallback callback | Completion callback to receive the result. |
void deleteFiles(@NonNull final List<MediaFile> files, |
Package: | dji.sdk.media |
Delete media files from storages. If the operation is started successfully, FileListState
will become DELETING
. If there is error or "failedFiles" is not empty, FileListState
will become RESET
.
@NonNull final List<MediaFile> files | A list of MediaFile objects. |
final CompletionCallbackWithTwoParam<List<MediaFile>, DJICameraError> callback | A completion callback of CompletionCallbackWithTwoParam<List<MediaFile>. |
void exitMediaDownloading() |
Package: | dji.sdk.media |
This will entirely stop the downloading process and of course clean the downloading thread pool. The camera will exit the MEDIA_DOWNLOAD mode and enter the SHOOT_PHOTO mode.
Precondition:
The camera enters the MediaDownload mode.
Post Condition:
After this function invoked, the camera mode will shift to TAKEPHOTO mode.
void addUpdateFileListStateListener(@NonNull FileListStateListener listener) |
Package: | dji.sdk.media |
Start listen to the update of file list state.
@NonNull FileListStateListener listener | A FileListStateListener interface. |
void addUpdateStorageLocationListener(@NonNull SettingsDefinitions.StorageLocation storageLocation, |
Package: | dji.sdk.media |
Start listen to the update of file list state.
@NonNull SettingsDefinitions.StorageLocation storageLocation | The storage location of the file list. |
@NonNull FileListStateListener listener | A FileListStateListener interface. |
void removeFileListStateCallback(@NonNull FileListStateListener listener) |
Package: | dji.sdk.media |
Stop listen to the update of file list state.
@NonNull FileListStateListener listener | A FileListStateListener interface. |
boolean isVideoPlaybackSupported() |
Package: | dji.sdk.media |
Checks if the media manager supports video playback or not. @return true
if the media manager supports video playback.
boolean | true if the media manager supports video playback. |
void playVideoMediaFile(@NonNull MediaFile videoMediaFile, @Nullable final CompletionCallback callback) |
Package: | dji.sdk.media |
Start video playback through MediaManager
. When the media manager is playing a video, playback state received from onUpdate
. Video playback through MediaManager
is fixed at 720p.
@NonNull MediaFile videoMediaFile | The video to play. |
@Nullable final CompletionCallback callback | The execution callback with the returned execution result. |
void resume(@Nullable final CompletionCallback callback) |
Package: | dji.sdk.media |
The media manager resumes the paused video.
@Nullable final CompletionCallback callback | The execution callback with the returned execution result. |
void pause(@Nullable final CompletionCallback callback) |
Package: | dji.sdk.media |
The media manager pauses the playing video.
@Nullable final CompletionCallback callback | The execution callback with the returned execution result. |
void stop(@Nullable final CompletionCallback callback) |
Package: | dji.sdk.media |
The media manager stops the playing video.
@Nullable final CompletionCallback callback | The execution callback with the returned execution result. |
void moveToPosition(@FloatRange(from = 0) float position, @Nullable final CompletionCallback callback) |
Package: | dji.sdk.media |
Video playback is skipped to the new position in seconds from the start of the video.
@FloatRange(from = 0) float position | New position to play in seconds from start of video. Input with precision of greater than 3 decimal places, will be rounded to 3. |
@Nullable final CompletionCallback callback | The execution callback with the returned execution result. |
protected boolean isCustomizeDCFFileSupported() |
Package: | dji.sdk.media |
Checks if the media manager supports customize DCF file naming rule or not. It is Only supported by Zenmuse H20 series.
protected boolean | true if the camera supports customize DCF file. |
void fetchThumbnail(@Nullable final CompletionCallback callback) |
Package: | dji.sdk.media |
Fetches this media's thumbnail with a resolution (99 x 99) from the SD card. This method can be used to fetch either a photo or a video, where the first frame of the video is the thumbnail that is fetched. It is not available if the media type is Panorama.
Precondition:
The camera mode is MediaDownload mode.
Post Condition:
This method will start to download the media thumbnail in the SD card. The content can be videos or images.
@Nullable final CompletionCallback callback | The completion callback with the returned execution result. |
enum FileListState |
Package: | dji.sdk.media |
States of the file list in MediaManager
.
UP_TO_DATE | The file list is up-to-date: it is synchronized with the SD card in the aircraft. |
INCOMPLETE | New files have been generated since the last call of refreshFileListOfStorageLocation . Calling refreshFileListOfStorageLocation can synchronize the newly generated files and append them to the end of the file list. |
RESET | The file list is reset. The file list will be reset in one of the following cases: - Camera is disconnected. - SD card is formatted. - SD card is not inserted. - Error occurs when deleting files from SD card. In this state, getSDCardFileListSnapshot will return null . |
DELETING | deleteFiles has been called and the operation is still in progress. |
RENAMING | A renaming operation is in progress. |
SYNCING | The media manager is synchronizing the file list from the SD card. |
UNKNOWN | Unknown. |