DJI Mobile SDK Documentation

      class AudioMediaFile

      class AudioMediaFile extends MediaFile
      Package:dji.sdk.media
      Inherits From:MediaFile
      Description:

      This class represents the information of an audio file in the aircraft. The audio file is not accessible if the aircraft is connected to a PC with the USB port. For M2E Speaker, it only supports audio files with the following conditions: The audio channel is mono. The audio sample rate is 44,100 Hz. The PCM (Pulse-code modulation) sample depth is 16 bit per sample. The AudioMediaFile contains following properties:
      - getFileName
      - getDurationInSeconds
      - getIndex
      - getStorageLocation

      Class Members:
      method getAudioStorageLocation
      SettingsDefinitions.AudioStorageLocation getAudioStorageLocation()
      Package:dji.sdk.media
      Description:

      The storage location to store the file in the aircraft.

      Return:
      SettingsDefinitions.AudioStorageLocationAn enum value of the AudioStorageLocation.
      enum AudioStorageLocation
      enum AudioStorageLocation
      Package:dji.common.accessory
      Description:

      Storage types of audio files. The storage types will determine the strategy of the aircraft to keep the file.

      Enum Members:
      TEMPORARYThe audio file is stored to a temporary space. Files with temporary storage location will be automatically deleted when the aircraft reboots.
      PERSISTENTThe audio file is stored to a persistent space. Files with persistent storage location should be deleted manually by calling delete.
      UNKNOWNUnknown.
      Class Members:
      Inherited Methods:
      dji.sdk.media.MediaFile
      method
      method getFileName
      String getFileName()
      Package:dji.sdk.media
      Description:

      Returns the name of the media file in the SD Card.

      Return:
      StringA String instance of the name of the media file.
      method
      method isValid
      boolean isValid()
      Package:dji.sdk.media
      Description:

      true if the media file is still valid. If a media file is from the file list of the media manager, the file will become invalid after the file list is reset.

      Return:
      booleanA boolean value to check if the media file is still valid.
      method
      method getIndex
      int getIndex()
      Package:dji.sdk.media
      Description:

      Get the file index used in the camera.

      Return:
      intAn int value of the file index.
      method getMediaType
      MediaType getMediaType()
      Package:dji.sdk.media
      Description:

      Returns the type of media file.

      Return:
      MediaTypeAn enum value of MediaType.
      method getQuickShotVideoType
      @Nullable
      QuickShotVideoType getQuickShotVideoType()
      Package:dji.sdk.media
      Description:

      Returns the type of QuickShot video media file. It is valid when getVideoFileType is QUICK_SHOT.

      Return:
      QuickShotVideoTypeAn enum value of QuickShotVideoType.
      method getShootPhotoMode
      ShootPhotoMode getShootPhotoMode()
      Package:dji.sdk.media
      Description:

      Returns the ShootPhotoMode of a photo. Returns null if getMediaType is MOV or MP4.

      Return:
      ShootPhotoModeAn enum value of ShootPhotoMode.
      method getPanoramaMode
      PhotoPanoramaMode getPanoramaMode()
      Package:dji.sdk.media
      Description:

      Returns the PhotoPanoramaMode of a photo. It is valid when getShootPhotoMode is PANORAMA.

      Return:
      PhotoPanoramaModeAn enum value of PhotoPanoramaMode.
      method getDownloadedSize
      long getDownloadedSize()
      Package:dji.sdk.media
      Description:

      Downloaded size in Bytes of the media file.

      Return:
      longA long value of downloaded size.
      method getFileSize
      long getFileSize()
      Package:dji.sdk.media
      Description:

      Returns the size, in bytes, of the media file.

      Return:
      longSize of media file.
      method getDateCreated
      String getDateCreated()
      Package:dji.sdk.media
      Description:

      Returns the time when the media file was created as a string in the format "yyyy-MM-dd kk:mm:ss".

      Return:
      StringA String instance of the media file created date.
      method getTimeCreated
      long getTimeCreated()
      Package:dji.sdk.media
      Description:

      Returns the time when the media file was created as a long type.

      Return:
      longA long value of the media file created date.
      method getDurationInSeconds
      float getDurationInSeconds()
      Package:dji.sdk.media
      Description:

      If the media file is a video, this property returns the duration of the video in seconds. Will be 0s if the media file is a photo.

      Return:
      floatMedia duration.
      method getFrameRate
      VideoFrameRate getFrameRate()
      Package:dji.sdk.media
      Description:

      Frame rate when the media file is a video.

      Return:
      VideoFrameRateAn int value.
      method getResolution
      VideoResolution getResolution()
      Package:dji.sdk.media
      Description:

      Camera resolution.

      Return:
      VideoResolutionAn enum value of VideoResolution.
      method getVideoOrientation
      Orientation getVideoOrientation()
      Package:dji.sdk.media
      Description:

      The orientation of the camera when the video file was first recorded. If the camera orientation changes during a video capture, this will report the initial orientation. Will be LANDSCAPE if the media file is a photo. Only Mavic Pro supports this property. Will be LANDSCAPE for other products.

      Return:
      OrientationAn enum value of Orientation
      method getStorageLocation
      StorageLocation getStorageLocation()
      Package:dji.sdk.media
      Description:

      Storage location of the media file.

      Return:
      StorageLocationAn enum value of StorageLocation.
      method getVideoFileType
      @Nullable
      VideoFileType getVideoFileType()
      Package:dji.sdk.media
      Description:

      Returns the type of video media file. This property is only valid when the getMediaType is MOV or MP4. Returns null for other media types.

      Return:
      VideoFileTypeAn enum value of VideoFileType.
      method getCustomInformation
      String getCustomInformation()
      Package:dji.sdk.media
      Description:

      Custom information can be stored in media file's XMP meta data using setMediaFileCustomInformation This property contains the information that was written to this media file. If this property returns null, use fetchCustomInformation to populate it. Only supported by Phantom 4 Pro, Phantom 4 Advanced and Inspire 2 with firmware versions from after May 23 2017.

      Return:
      StringA string value.
      method getThumbnail
      Bitmap getThumbnail()
      Package:dji.sdk.media
      Description:

      Returns the thumbnail for this media. If this property returns nil, call fetchThumbnail.

      Return:
      BitmapA Bitmap object.
      method getPreview
      Bitmap getPreview()
      Package:dji.sdk.media
      Description:

      Returns the preview image for this media. If this property returns null, call fetchPreview.

      Return:
      BitmapA Bitmap object.
      method resetThumbnail
      void resetThumbnail(@Nullable final CompletionCallback callback)
      Package:dji.sdk.media
      Description:

      Resets the cached thumbnail to null to release the memory usage.

      Input Parameters:
      @Nullable final CompletionCallback callbackCompletion callback with the returned execution result.
      method fetchPreview
      void fetchPreview(@NonNull final CompletionCallback callback)
      Package:dji.sdk.media
      Description:

      Fetch media's preview image. The preview image is a lower resolution (960 x 540) version of a photo. The MediaType of this media object should be JPEG or TIFF. The preview will be stored in getPreview.

      Input Parameters:
      @NonNull final CompletionCallback callbackThe completion callback with the returned execution result.
      method resetPreview
      void resetPreview(@Nullable final CompletionCallback callback)
      Package:dji.sdk.media
      Description:

      Resets the cached preview image to null to release the memory usage.

      Input Parameters:
      @Nullable final CompletionCallback callbackThe completion callback with the returned execution result.
      method fetchCustomInformation
      void fetchCustomInformation(@NonNull CompletionCallback callback)
      Package:dji.sdk.media
      Description:

      Custom information can be stored in media file's XMP meta data using setMediaFileCustomInformation. The information will be stored in getCustomInformation. Only supported by Phantom 4 Pro, Phantom 4 Advanced, Phantom 4 Pro V2.0, Zenmuse X4S, Zenmuse X5S, Zenmuse X7 and Mavic 2 Enterprise camera.

      Input Parameters:
      @NonNull CompletionCallback callbackThe completion callback with the returned execution result.
      method fetchFileData
      void fetchFileData(@NonNull final File destDir,
      @Nullable String fileNameWithoutExtension,
      @NonNull final DownloadListener<String> callback)
      Package:dji.sdk.media
      Description:

      Fetches this media file's full resolution data from the SD card. The difference between fetching the media data and fetching the thumbnail is that fetching the thumbnail will return a low-resolution image of the actual picture, while fetching the media data will return all data for a video or image. If last download action is aborted, it will continue to download the data from where the file download has been aborted. Not supported by Phantom 4 RTK. Please use setHighQualityPreviewEnabled to fetch high quality preview instead.

      Input Parameters:
      @NonNull final File destDirFile instance of location to save the files, which can not be null.
      @Nullable String fileNameWithoutExtensionThe fileName to store in mobile devices, without the file extension.<br> If it is null, the file name in the camera's SDCard will be used.
      @NonNull final DownloadListener<String> callbackCompletion callback that receives the execution result.
      method stopFetchingFileData
      void stopFetchingFileData (@Nullable CompletionCallback callback)
      Package:dji.sdk.media
      Description:

      Stops a currently executing call of fetchFileData.

      Input Parameters:
      @Nullable CompletionCallback callbackThe completion callback with the returned execution result.
      method fetchSubFileDataList
      void fetchSubFileDataList(@NonNull final CompletionCallbackWith<List<MediaFile>> callback)
      Package:dji.sdk.media
      Description:

      Fetches the file data of the sub media files. It is available only when getMediaType is PANORAMA or SHALLOW_FOCUS.

      Input Parameters:
      @NonNull final CompletionCallbackWith<List<MediaFile>> callbackCompletion callback that receives the execution result.