DJI Mobile SDK Documentation

      class PlaybackManager

      class PlaybackManager
      Package:dji.sdk.camera
      Description:

      The playback manager is used to interact with the playback system of the camera. By using the playback manager, the user can control the playback system.

      Class Members:

      State Updates

      method setPlaybackStateCallback
      void setPlaybackStateCallback(PlaybackState.CallBack cameraPlayBackStateCB)
      Package:dji.sdk.camera
      Description:

      Sets the camera's playback state callback. Called according to the camera's update timer.

      Precondition:
      You must first define a Callback object to pass in as a parameter.

      Post Condition:
      Every time the playback state changes, the Callback interface that was passed in as a parameter will call its onResult function.
      The onResult function takes in a DJICameraPlayBackState object, which provides playback information such as the number of photos currently selected, the video playback progress (if a video is being played), and much more.

      Input Parameters:
      PlaybackState.CallBack cameraPlayBackStateCBThe Callback object to set as the callback interface for when the playback state changes. <br> The Callback interface implements an onResult function, which takes in a DJICameraPlayBackState object from the aircraft. <br>


      Single Preview Mode

      method enterSinglePreviewModeWithIndex
      DJIError enterSinglePreviewModeWithIndex(int index)
      Package:dji.sdk.camera
      Description:

      Enters single file preview mode for a file at the specified index. In order for this method to be called, the camera work mode must be PLAYBACK.

      @return DJICameraError Shows the possible error during the execution. If there is no error, it returns null.

      Input Parameters:
      int indexFile to be previewed at the specified index. The value falls in [1,8].
      Return:
      DJIErrorDJICameraError shows the possible error during the execution. If there is no error, it returns null.
      method proceedToNextSinglePreviewPage
      DJICameraError proceedToNextSinglePreviewPage()
      Package:dji.sdk.camera
      Description:

      Goes to the next page.

      Precondition:
      The camera must enter Single File Preview Mode.

      Special case:
      If it is the last image, it will go to the first image. @return DJICameraError Shows the possible error during the execution. If there is no error, it returns null.

      Return:
      DJICameraErrorDJICameraError shows the possible error during the execution. If there is no error, it returns null.
      method proceedToPreviousSinglePreviewPage
      DJICameraError proceedToPreviousSinglePreviewPage()
      Package:dji.sdk.camera
      Description:

      Goes back to the previous page.

      Precondition:
      The camera must enter Single File Preview Mode.

      Special case:
      If it is the first image, it will go to the last image. @return DJICameraError Shows the possible error during the execution. If there is no error, it returns null.

      Return:
      DJICameraErrorDJICameraError shows the possible error during the execution. If there is no error, it returns null.
      Video Playback
      method
      method playVideo
      DJICameraError playVideo()
      Package:dji.sdk.camera
      Description:

      Starts video playback. The selected file must be a video file.

      Precondition:
      The camera must enter Single Preview Mode.

      Post condition:
      If the video finishes playing, it will stop and go back to the beginning of the file. @return DJICameraError Shows the possible error during the execution. If there is no error, it returns null.

      Return:
      DJICameraErrorDJICameraError shows the possible error during the execution. If there is no error, it returns null.
      method pauseVideo
      DJICameraError pauseVideo()
      Package:dji.sdk.camera
      Description:

      Pauses a video during playback.

      Precondition:
      The video is being played.
      @return DJICameraError Shows the possible error during the execution. If there is no error, it returns null.

      Return:
      DJICameraErrorDJICameraError shows the possible error during the execution. If there is no error, it returns null.
      method
      method stopVideo
      DJICameraError stopVideo()
      Package:dji.sdk.camera
      Description:

      Stops a video during playback.

      Precondition:
      The video is being played.

      Post condition:
      The file will stop and go back to the beginning of the file. @return DJICameraError Shows the possible error during the execution. If there is no error, it returns null.

      Return:
      DJICameraErrorDJICameraError shows the possible error during the execution. If there is no error, it returns null.
      method playVideoFromPositionInPercent
      DJIError playVideoFromPositionInPercent(int location)
      Package:dji.sdk.camera
      Description:

      Plays a video from the specified location. The selected file must be a video file.

      Precondition:
      The camera must enter Single File Preview Mode.

      Post condition:
      The file will play from a specific location immediately. This command can only be called if the video is currently playing or is paused. If paused, the playback position will be updated and playing will resume. @return DJICameraError Shows the possible error during the execution. If there is no error, it returns null.

      Input Parameters:
      int locationLocation from which to play the video must be in the range of [0, 100]. This value represents at what percent of the entire video it should start playing.
      Return:
      DJIErrorDJICameraError shows the possible error during the execution. If there is no error, it returns null.
      Delete File
      method
      method deleteCurrentPreviewFile
      DJICameraError deleteCurrentPreviewFile()
      Package:dji.sdk.camera
      Description:

      Deletes the current file being previewed.

      Precondition:
      The camera must enter single file preview mode.

      Post condition:
      The image will be deleted from the SD card. @return DJICameraError Shows the possible error during the execution. If there is no error, it returns null.

      Return:
      DJICameraErrorDJICameraError shows the possible error during the execution. If there is no error, it returns null.


      Multi Preview Mode

      Mode Control
      method
      method enterMultiplePreviewMode
      DJICameraError enterMultiplePreviewMode()
      Package:dji.sdk.camera
      Description:

      Enables the user to preview multiple files when the camera is in Playback mode.

      Precondition:
      The camera work mode should be set to Playback mode.

      Post condition:
      There will be 8 images on one page. @return DJICameraError Shows the possible error during the execution. If there is no error, it returns null.

      Return:
      DJICameraErrorDJICameraError shows the possible error during the execution. If there is no error, it returns null.
      method proceedToNextMultiplePreviewPage
      DJICameraError proceedToNextMultiplePreviewPage()
      Package:dji.sdk.camera
      Description:

      Goes to the next page when there are multiple pages.

      Precondition:
      The camera must enter Multiple Preview Mode.

      Special case:
      If it is the last page, it will stay at the last page. @return DJICameraErrorr Shows the possible error during the execution. If there is no error, it returns null.

      Return:
      DJICameraErrorDJICameraError shows the possible error during the execution. If there is no error, it returns null.
      method proceedToPreviousMultiplePreviewPage
      DJICameraError proceedToPreviousMultiplePreviewPage()
      Package:dji.sdk.camera
      Description:

      Goes back to the previous page when there are multiple pages.

      Precondition:
      The camera must enter Multiple Preview Mode.

      Special case:
      If it is the first page, it will stay at the first page. @return DJICameraError Shows the possible error during the execution. If there is no error, it returns null.

      Return:
      DJICameraErrorDJICameraError shows the possible error during the execution. If there is no error, it returns null.


      Multi Edit Mode

      Mode Control
      method
      method enterMultipleEditMode
      DJICameraError enterMultipleEditMode()
      Package:dji.sdk.camera
      Description:

      This enables the user to select, download, or delete multiple media files when the camera is in Playback mode.
      Precondition:
      The camera work mode must be set to Camera Play back mode and then Multiple Preview Mode.

      Post condition:
      Multiple photos can be selected to be downloaded or deleted. @return DJICameraError Shows the possible error during the execution. If there is no error, it returns null.

      Return:
      DJICameraErrorDJICameraError shows the possible error during the execution. If there is no error, it returns null.
      method exitMultipleEditMode
      DJICameraError exitMultipleEditMode()
      Package:dji.sdk.camera
      Description:

      Exits multiple edit mode. @return DJICameraError Shows the possible error during the execution. If there is no error, it returns null.

      Return:
      DJICameraErrorDJICameraError shows the possible error during the execution. If there is no error, it returns null.
      method toggleFileSelectionAtIndex
      DJIError toggleFileSelectionAtIndex(int index)
      Package:dji.sdk.camera
      Description:

      Selects or unselects a file at the specified index of the current page. This index is unrelated to the filename, and is used in multiple edit mode.

      Precondition:
      The camera must enter Multiple Edit Mode.
      @return DJICameraError Shows the possible error during the execution. If there is no error, it returns null.

      Input Parameters:
      int indexIndex at which to select a file. The value falls in [1,8]. However, the exact range should depends on how many photos totally in current page.
      Return:
      DJIErrorDJICameraError shows the possible error during the execution. If there is no error, it returns null.
      method selectAllFiles
      DJICameraError selectAllFiles()
      Package:dji.sdk.camera
      Description:

      Selects all the files on the SD card.

      Precondition:
      The camera must enter Multi Edit Mode. @return DJICameraError Shows the possible error during the execution. If there is no error, it returns null.

      Return:
      DJICameraErrorDJICameraError shows the possible error during the execution. If there is no error, it returns null.
      method unselectAllFiles
      DJICameraError unselectAllFiles()
      Package:dji.sdk.camera
      Description:

      Unselects all the files on the SD card.
      Precondition:
      The camera must enter Multiple Edit Mode. @return DJICameraError Shows the possible error during the execution. If there is no error, it returns null.

      Return:
      DJICameraErrorDJICameraError shows the possible error during the execution. If there is no error, it returns null.
      method selectAllFilesInPage
      DJICameraError selectAllFilesInPage()
      Package:dji.sdk.camera
      Description:

      Selects all the file(s) on the current page.

      Precondition:
      The camera must enter Multiple Edit Mode. @return DJICameraError Shows the possible error during the execution. If there is no error, it returns null.

      Return:
      DJICameraErrorDJICameraError shows the possible error during the execution. If there is no error, it returns null.
      method unselectAllFilesInPage
      DJICameraError unselectAllFilesInPage()
      Package:dji.sdk.camera
      Description:

      Unselects all the file(s) on the current page.

      Precondition:
      The camera must enter Multiple Edit Mode. @return DJICameraError Shows the possible error during the execution. If there is no error, it returns null.

      Return:
      DJICameraErrorDJICameraError shows the possible error during the execution. If there is no error, it returns null.
      Delete Files
      method
      method deleteAllSelectedFiles
      DJICameraError deleteAllSelectedFiles()
      Package:dji.sdk.camera
      Description:

      Deletes all selected files from the SD card.

      Precondition:
      The camera must enter Multiple Edit Mode.

      Post condition:
      The images will be deleted from the SD card. @return DJICameraError Shows the possible error during the execution. If there is no error, it returns null.

      Return:
      DJICameraErrorDJICameraError shows the possible error during the execution. If there is no error, it returns null.
      Download Files
      method
      method downloadSelectedFiles
      void downloadSelectedFiles(final File destDir, final FileDownloadCallback callback)
      Package:dji.sdk.camera
      Description:

      Downloads the currently selected media files.

      Precondition:
      The camera must enter multiple preview mode.

      Input Parameters:
      final File destDirThe destination file directory, e.g., SDCardPath/folder/
      final FileDownloadCallback callbackThe execution callback.


      State
      class