DJI Mobile SDK Documentation

      class IMediaManager

      interface IMediaManager
      Package:dji.v5.manager.interfaces
      Description:

      Media file management class, which providing functions such as media file list download, media file preview, download and video playback.

      Supported since MSDK 5.0.0

      Class Members:
      method
      method enable
      void enable( CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.interfaces
      Description:

      Enter the media file management module. Calling this interface, camera will enter media file management module. In this mode, you can pull media file list and playback the video in camera. At this time , camera will no be able to take photo and record, image transmission can not be display normally. It is suggested that you call this interface when you enter the album.

      Supported since MSDK 5.0.0

      Input Parameters:
      CommonCallbacks.CompletionCallback callbackReturn the execution result of callback.
      method
      method disable
      void disable(CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.interfaces
      Description:

      Exit the media file management module. Calling this interface, camera will exit media file management module. Camera can take photo and record normally and the image transmission will diaplay normally. It is suggested that you call this interface when you exit the album.

      Supported since MSDK 5.0.0

      Input Parameters:
      CommonCallbacks.CompletionCallback callbackReturn the execution result of callback.
      method addMediaFileListStateListener
      void addMediaFileListStateListener(MediaFileListStateListener listener)
      Package:dji.v5.manager.interfaces
      Description:

      Set media file list status listener. Through this listener, the status of media file list can be monitored.

      Supported since MSDK 5.0.0

      Input Parameters:
      MediaFileListStateListener listenerListener of media file list status.
      method removeMediaFileListStateListener
      void removeMediaFileListStateListener(MediaFileListStateListener listener)
      Package:dji.v5.manager.interfaces
      Description:

      Remove the listener of media file list status.

      Supported since MSDK 5.0.0

      Input Parameters:
      MediaFileListStateListener listenerListener of media file list status.
      method removeAllMediaFileListStateListener
      void removeAllMediaFileListStateListener()
      Package:dji.v5.manager.interfaces
      Description:

      Remove all the listeners of media file list status.

      Supported since MSDK 5.0.0

      method getMediaFileListState
      MediaFileListState getMediaFileListState()
      Package:dji.v5.manager.interfaces
      Description:

      Get the media file list status. This is an synchronous interface.

      Supported since MSDK 5.0.0

      Return:
      MediaFileListStateReturn the media file list status.
      method setMediaFileDataSource
      void setMediaFileDataSource(MediaFileListDataSource source)
      Package:dji.v5.manager.interfaces
      Description:

      Set the data source of media file that needed. You can choose media file from selected storage location and selected loads.

      Supported since MSDK 5.0.0

      Input Parameters:
      MediaFileListDataSource sourceData source of media file.
      method pullMediaFileListFromCamera
      void pullMediaFileListFromCamera(@NonNull PullMediaFileListParam param, CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.interfaces
      Description:

      Pull the media file list from camera. When the media file list status MediaFileListState is IDLE, this method should be called to pull full data. When the media file list status MediaFileListState changes to UP_TO_DATE, it means that the process of pulling media file list is finished. Please call the getMediaFileListData to get media file list data.

      Supported since MSDK 5.0.0

      Input Parameters:
      @NonNull PullMediaFileListParam paramParameters of media file list.
      CommonCallbacks.CompletionCallback callbackReturn the execution result of callback.
      method stopPullMediaFileListFromCamera
      void stopPullMediaFileListFromCamera()
      Package:dji.v5.manager.interfaces
      Description:

      Stop pulling the media file list from camera.

      Supported since MSDK 5.0.0

      method getMediaFileListData
      MediaFileListData getMediaFileListData()
      Package:dji.v5.manager.interfaces
      Description:

      Get parameters of media file list. When the media file list status MediaFileListState is monitored to change to UP_TO_DATE, it means media file list have updated. This interface should be called again to update the media file list data.

      Supported since MSDK 5.0.0

      Return:
      MediaFileListDataReturn parameters of media file list.
      method deleteMediaFiles
      void deleteMediaFiles(List<MediaFile> files, CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.interfaces
      Description:

      Delete the media file in camera. After calling this interface, media file list status MediaFileListState will change to UPDATING. After the deletion, the media file list status MediaFileListState is UP_TO_DATE, please call getMediaFileListData to update media file list data.

      Supported since MSDK 5.0.0

      Input Parameters:
      List<MediaFile> filesMedia file list that needs to be deleted.
      CommonCallbacks.CompletionCallback callbackReturn the execution result of callback.
      method
      method playVideo
      void playVideo(MediaFile mediaFile, CommonCallbacks.CompletionCallbackWithParam<IVideoFrame> callback)
      Package:dji.v5.manager.interfaces
      Description:

      Start to play the set media file. Media file data can be obtained by callback method.

    • 1. If you want to decode to display the video by yourself, you can call custom decoder to decode the video through the video frame data IVideoFrame obtained from callback.
    • 2. You can also use the decoder IVideoDecoder provided by DJI to decode video. Using EXTENDED_STREAM_CHANNEL to init IVideoDecoder, and then call setMediaFile to set the media file into the decoder. Finally, call queueInFrame to send the video frame data IVideoFrame to decode.


    • Supported since MSDK 5.0.0

      Input Parameters:
      MediaFile mediaFileMedia file list that needs to playback.
      CommonCallbacks.CompletionCallbackWithParam<IVideoFrame> callbackReturn the execution result of callback.
      method
      method seekVideo
      void seekVideo(int position, CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.interfaces
      Description:

      Jump to play media file. You can set a new position to play.

      Supported since MSDK 5.0.0

      Input Parameters:
      int positionThe location where you need to jump to play. Unit:second.
      CommonCallbacks.CompletionCallback callbackReturn the execution result of callback.
      method pauseVideo
      void pauseVideo(CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.interfaces
      Description:

      Pause playing the media file.

      Supported since MSDK 5.0.0

      Input Parameters:
      CommonCallbacks.CompletionCallback callbackReturn the execution result of callback.
      method resumeVideo
      void resumeVideo(CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.interfaces
      Description:

      Resume to play the media file.

      Supported since MSDK 5.0.0

      Input Parameters:
      CommonCallbacks.CompletionCallback callbackReturn the execution result of callback.
      method
      method stopVideo
      void stopVideo(CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.interfaces
      Description:

      Stop playing the media file.

      Supported since MSDK 5.0.0

      Input Parameters:
      CommonCallbacks.CompletionCallback callbackReturn the execution result of callback.
      method addVideoPlayStateListener
      void addVideoPlayStateListener(VideoPlayStateListener listener)
      Package:dji.v5.manager.interfaces
      Description:

      Set the listener of media file playing status. Through this listener, status of media file playing can be monitored.

      Supported since MSDK 5.0.0

      Input Parameters:
      VideoPlayStateListener listenerListener of media file playing status.
      method removeVideoPlayStateListener
      void removeVideoPlayStateListener(VideoPlayStateListener listener)
      Package:dji.v5.manager.interfaces
      Description:

      Remove listener of media file playing status.

      Supported since MSDK 5.0.0

      Input Parameters:
      VideoPlayStateListener listenerListener of media file playing status.
      method removeAllVideoPlayStateListener
      void removeAllVideoPlayStateListener()
      Package:dji.v5.manager.interfaces
      Description:

      Remove listeners of media file playing status.

      Supported since MSDK 5.0.0

      method
      method release
      void release()
      Package:dji.v5.manager.interfaces
      Description:

      Resource release. Calling this interface will cancel the media file data downloading, clear the thumbnail cache and clear the media file list data. It is recommended that you call it when the system memory is insufficient.

      Supported since MSDK 5.0.0

      enum MediaFileFilter
      enum MediaFileFilter
      Package:dji.v5.manager.datacenter.media
      Description:

      Pulling media file list filter setting class.

      Supported since MSDK 5.0.0

      Enum Members:
      VIDEOVideo.
      PHOTOPhoto.
      ALLAll media files.
      Class Members:
      enum MediaFileListState
      enum MediaFileListState
      Package:dji.v5.manager.datacenter.media
      Description:

      Media file list status.

      Supported since MSDK 5.0.0

      Enum Members:
      IDLEIDLE status. When the media file list is in IDLE status, pullMediaFileListFromCamera should be called to pull full data.
      UP_TO_DATEUpdated status. When the media file list is in updated status, getMediaFileListData should be called to update the media file list data.
      UPDATINGUpdating status. When the media file list is in updating status, it means that the MSDK is synchronizing with date in camera. After the synchronization, the status will change to UP_TO_DATE, getMediaFileListData should be called to update the media file list data.
      Class Members:
      enum VideoPlayState
      enum VideoPlayState
      Package:dji.v5.manager.datacenter.media
      Description:

      Enum type of media file playing status.

      Supported since MSDK 5.0.0

      Enum Members:
      IDLEIDEL status. The media file play function is not enabled. playVideo can be called to play media file.
      PLAYINGPlaying.
      ENDEDPlay is ended.
      STOPPEDPlay is stopped. When stopVideo is called successfully to stop playing media file, this status will be called back.
      Class Members: