DJI Mobile SDK Documentation

      class MediaFile

      class MediaFile implements Serializable
      Package:dji.v5.manager.datacenter.media
      Description:

      Media file data class.

      Supported since MSDK 5.0.0

      Class Members:
      method getFileIndex
      int getFileIndex()
      Package:dji.v5.manager.datacenter.media
      Description:

      Get index of media file.

      Supported since MSDK 5.0.0

      Return:
      intReturn index of media file.
      method getFileType
      MediaFileType getFileType()
      Package:dji.v5.manager.datacenter.media
      Description:

      Get type of media file.

      Supported since MSDK 5.0.0

      Return:
      MediaFileTypeReturn type of media file.
      method getFileName
      String getFileName()
      Package:dji.v5.manager.datacenter.media
      Description:

      Get name of media file.
      Notice:
      Zenmuse P1 cannot obtain the extension name of the customized file. This is a legacy issue in the camera protocol design.



      Supported since MSDK 5.0.0

      Return:
      StringReturn name of media file.
      method getFileSize
      long getFileSize()
      Package:dji.v5.manager.datacenter.media
      Description:

      Get size of media file. Unit: byte.

      Supported since MSDK 5.0.0

      Return:
      longReturn size of media file.
      method
      method getDate
      DateTime getDate()
      Package:dji.v5.manager.datacenter.media
      Description:

      Get the generation time of media file.

      Supported since MSDK 5.0.0

      Return:
      DateTimeReturn the generation time of media file.
      method getDuration
      Long getDuration()
      Package:dji.v5.manager.datacenter.media
      Description:

      Get the duration of video play. Unit: second.

      Supported since MSDK 5.0.0

      Return:
      LongReturn the duration of video play.
      method getFrameRate
      VideoFrameRate getFrameRate()
      Package:dji.v5.manager.datacenter.media
      Description:

      Get video framerate.

      Supported since MSDK 5.0.0

      Return:
      VideoFrameRateReturn video framerate.
      method getResolution
      VideoResolution getResolution()
      Package:dji.v5.manager.datacenter.media
      Description:

      Get video resolution.

      Supported since MSDK 5.0.0

      Return:
      VideoResolutionReturn video resolution.
      method getPhotoRatio
      PhotoRatio getPhotoRatio()
      Package:dji.v5.manager.datacenter.media
      Description:

      Get photo ratio.

      Supported since MSDK 5.0.0

      Return:
      PhotoRatioReturn photo ratio.
      method getThumbNail
      Bitmap getThumbNail()
      Package:dji.v5.manager.datacenter.media
      Description:

      Get media file thumbnail. Please call pullThumbnailFromCamera to pull the thumbnail from the camera first, and save to the memory.

      Supported since MSDK 5.0.0

      Return:
      BitmapReturn media file thumbnail.
      method pullThumbnailFromCamera
      void pullThumbnailFromCamera(CommonCallbacks.CompletionCallbackWithParam<Bitmap> callback)
      Package:dji.v5.manager.datacenter.media
      Description:

      Pull the thumbnail of media file from the camera. The pulled thumbnail will be returned to the developer in the callback method and will be saved to the memory at the same time. You can call getThumbNail to get thumbnail from the memory.

      Supported since MSDK 5.0.0

      Input Parameters:
      CommonCallbacks.CompletionCallbackWithParam<Bitmap> callbackReturn the execution result of callback.
      method pullPreviewFromCamera
      void pullPreviewFromCamera(@NonNull CommonCallbacks.CompletionCallbackWithParam<Bitmap> callback)
      Package:dji.v5.manager.datacenter.media
      Description:

      Pull the preview of media file from the camera. The pulled preview will be returned to the developer in the callback method. MSDK will no save the preview in memory and you can save it as needed.

      Supported since MSDK 5.0.0

      Input Parameters:
      @NonNull CommonCallbacks.CompletionCallbackWithParam<Bitmap> callbackReturn the execution result of callback.
      method stopPullPreviewFromCamera
      void stopPullPreviewFromCamera(@NonNull CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.datacenter.media
      Description:

      Stop pulling the preview of media file.

      Supported since MSDK 5.0.0

      Input Parameters:
      @NonNull CommonCallbacks.CompletionCallback callbackReturn the execution result of callback.
      method pullOriginalMediaFileFromCamera
      void pullOriginalMediaFileFromCamera(long offset, @NonNull MediaFileDownloadListener callback)
      Package:dji.v5.manager.datacenter.media
      Description:

      Pull the origin media file from the camera. The pulled media file will be returned to the developer in the callback method. MSDK will no save the origin media file in memory and you can save it as needed.

      Supported since MSDK 5.0.0

      Input Parameters:
      long offsetOffset value of media file download. Unit:byte.
      @NonNull MediaFileDownloadListener callbackReturn the execution result of callback.
      method stopPullOriginalMediaFileFromCamera
      void stopPullOriginalMediaFileFromCamera(CommonCallbacks.CompletionCallback callback)
      Package:dji.v5.manager.datacenter.media
      Description:

      Stop pulling origin media file.

      Supported since MSDK 5.0.0

      Input Parameters:
      CommonCallbacks.CompletionCallback callbackReturn the execution result of callback.
      method pullXMPFileDataFromCamera
      void pullXMPFileDataFromCamera(CommonCallbacks.CompletionCallbackWithParam<String> callback)
      Package:dji.v5.manager.datacenter.media
      Description:

      Pull XMP information in photo file from the camera.
      Notice:
      Currently only supports Zenmuse H20 series cameras, Zenmuse L1 camera, and Zenmuse P1 camera.


      Supported since MSDK 5.7.0

      Input Parameters:
      CommonCallbacks.CompletionCallbackWithParam<String> callbackReturn the execution result of callback.
      method getXMPFileData
      String getXMPFileData()
      Package:dji.v5.manager.datacenter.media
      Description:

      Synchronously obtain XMP information in photo file. If the return is empty, please call pullXMPFileDataFromCamera to pull XMP information from the camera.
      Notice:
      Currently only supports Zenmuse H20 series cameras, Zenmuse L1 camera, and Zenmuse P1 camera.


      Supported since MSDK 5.7.0

      Return:
      StringReturn XMP information in photo file.
      method pullXMPCustomInfoFromCamera
      void pullXMPCustomInfoFromCamera(CommonCallbacks.CompletionCallbackWithParam<String> callback)
      Package:dji.v5.manager.datacenter.media
      Description:

      Pull XMP custom information in photo file from the camera.
      Notice:
      Currently only supports Zenmuse H20 series cameras, Zenmuse L1 camera, and Zenmuse P1 camera.


      Supported since MSDK 5.7.0

      Input Parameters:
      CommonCallbacks.CompletionCallbackWithParam<String> callbackReturn the execution result of callback.
      method getXMPCustomInfo
      String getXMPCustomInfo()
      Package:dji.v5.manager.datacenter.media
      Description:

      Synchronously obtain XMP custom information in photo file. If the return is empty, please call pullXMPFileDataFromCamera to pull XMP information from the camera.
      Notice:
      Currently only supports Zenmuse H20 series cameras, Zenmuse L1 camera, and Zenmuse P1 camera.


      Supported since MSDK 5.7.0

      Return:
      StringReturn XMP custom information in photo file.