DJI Mobile SDK Documentation

      class DJIPlaybackManager

      @interface DJIPlaybackManager : NSObject
      Header:DJIPlaybackManager.h
      Inherits From:NSObject
      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

      Playback
      property
      property delegate
      @property(nonatomic, weak) id<DJIPlaybackDelegate> delegate
      Header:DJIPlaybackManager.h
      Description:

      Returns the delegate of DJIPlaybackManager

      See Also:

      DJIPlaybackDelegate


      Single Preview Mode

      method enterSinglePreviewModeWithIndex
      - (void)enterSinglePreviewModeWithIndex:(uint8_t)index
      Header:DJIPlaybackManager.h
      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 DJICameraModePlayback.

      Input Parameters:
      uint8_t indexFile to be previewed at the specified index. The value falls in [1,8].
      Page Control
      method
      method goToNextSinglePreviewPage
      - (void)goToNextSinglePreviewPage
      Header:DJIPlaybackManager.h
      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.

      method goToPreviousSinglePreviewPage
      - (void)goToPreviousSinglePreviewPage
      Header:DJIPlaybackManager.h
      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.

      Video Playback
      method
      method playVideo
      - (void)playVideo
      Header:DJIPlaybackManager.h
      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.

      method pauseVideo
      - (void)pauseVideo
      Header:DJIPlaybackManager.h
      Description:

      Pauses a video during playback.

      Precondition:
      The video is being played.

      method
      method stopVideo
      - (void)stopVideo
      Header:DJIPlaybackManager.h
      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.

      method playVideoFromPositionInPercent
      - (void)playVideoFromPositionInPercent:(uint8_t)position
      Header:DJIPlaybackManager.h
      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.

      Input Parameters:
      uint8_t positionLocation 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.
      Delete File
      method
      method deleteCurrentPreviewFile
      - (void)deleteCurrentPreviewFile
      Header:DJIPlaybackManager.h
      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.


      Multi Preview Mode

      Mode Control
      method
      method enterMultiplePreviewMode
      - (void)enterMultiplePreviewMode
      Header:DJIPlaybackManager.h
      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.

      Page Control
      method
      method goToNextMultiplePreviewPage
      - (void)goToNextMultiplePreviewPage
      Header:DJIPlaybackManager.h
      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.

      method goToPreviousMultiplePreviewPage
      - (void)goToPreviousMultiplePreviewPage
      Header:DJIPlaybackManager.h
      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.


      Multi Edit Mode

      Mode Control
      method
      method enterMultipleEditMode
      - (void)enterMultipleEditMode
      Header:DJIPlaybackManager.h
      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.

      method exitMultipleEditMode
      - (void)exitMultipleEditMode
      Header:DJIPlaybackManager.h
      Description:

      Exits multiple edit mode.

      method toggleFileSelectionAtIndex
      - (void)toggleFileSelectionAtIndex:(int)index
      Header:DJIPlaybackManager.h
      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.

      Input Parameters:
      int indexIndex at which to select a file.
      method selectAllFiles
      - (void)selectAllFiles
      Header:DJIPlaybackManager.h
      Description:

      Selects all the files on the SD card.

      Precondition:
      The camera must enter Multi Edit Mode.

      method unselectAllFiles
      - (void)unselectAllFiles
      Header:DJIPlaybackManager.h
      Description:

      Unselects all the files on the SD card.
      Precondition:
      The camera must enter Multiple Edit Mode.

      method selectAllFilesInPage
      - (void)selectAllFilesInPage
      Header:DJIPlaybackManager.h
      Description:

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

      Precondition:
      The camera must enter Multiple Edit Mode.

      method unselectAllFilesInPage
      - (void)unselectAllFilesInPage
      Header:DJIPlaybackManager.h
      Description:

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

      Precondition:
      The camera must enter Multiple Edit Mode.

      Delete Files
      method
      method deleteAllSelectedFiles
      - (void)deleteAllSelectedFiles
      Header:DJIPlaybackManager.h
      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.

      method downloadSelectedFilesWithPreparation:process:fileCompletion:overallCompletion
      - (void)downloadSelectedFilesWithPreparation:(nullable DJIFileDownloadPreparingBlock)prepareBlock
      process:(nullable DJIFileDownloadingBlock)dataBlock
      fileCompletion:(nullable DJIFileDownloadCompletionBlock)fileCompletionBlock
      overallCompletion:(nullable DJICompletionBlock)finishBlock
      Header:DJIPlaybackManager.h
      Description:

      Downloads the currently selected media files.

      Precondition:
      The camera must enter multiple preview mode.

      Input Parameters:
      nullable DJIFileDownloadPreparingBlock prepareBlockCallback to prepare each file for download.
      nullable DJIFileDownloadingBlock dataBlockCallback while a file is downloading. The dataBlock can be called multiple times for a file. The error argument in <code>DJIFileDownloadingBlock</code> is not used and should be ignored.
      nullable DJIFileDownloadCompletionBlock fileCompletionBlockCallback after each file have been downloaded.
      nullable DJICompletionBlock finishBlockCallback after the downloading is finished.
      method stopDownloadingFilesWithCompletion
      - (void)stopDownloadingFilesWithCompletion:(nullable DJICompletionBlock)block
      Header:DJIPlaybackManager.h
      Description:

      Cancel current file download.

      Input Parameters:
      nullable DJICompletionBlock blockCallback after the operation finished.


      State Updates
      protocol
      protocol DJIPlaybackDelegate
      @protocol DJIPlaybackDelegate <NSObject>
      Header:DJIPlaybackManager.h
      Inherits From:NSObject
      Description:

      The protocol provides a delegate method to receive the updated state of the playback manager.

      Protocol Methods:

      Protocol Method

      method playbackManager:didUpdatePlaybackState
      @required
      - (void)playbackManager:(DJIPlaybackManager *_Nonnull)playbackManager didUpdatePlaybackState:(DJICameraPlaybackState *_Nonnull)playbackState
      Header:DJIPlaybackManager.h
      Description:

      Updates the playback state of the camera. This update method will only be called when the camera's work mode is set to DJICameraModePlayback.

      Input Parameters:
      DJIPlaybackManager *_Nonnull playbackManagerDJIPlaybackManager object.
      DJICameraPlaybackState *_Nonnull playbackStateThe camera's playback state.
      typedef block DJIFileDownloadPreparingBlock
      typedef void (^_Nullable DJIFileDownloadPreparingBlock)(NSString *_Nullable fileName, DJIDownloadFileType fileType, NSUInteger fileSize, BOOL *skip)
      Header:DJIPlaybackManager.h
      Description:

      Block invoked when preparing a file for download.

      Input Parameters:
      NSString *_Nullable fileNameFile name.
      DJIDownloadFileType fileTypeType of file.
      NSUInteger fileSizeSize of file.
      BOOL * skipCan be set to decide whether or not to skip the file.
      typedef block DJIFileDownloadingBlock
      typedef void (^_Nullable DJIFileDownloadingBlock)(NSData *_Nullable data, NSError *_Nullable error)
      Header:DJIPlaybackManager.h
      Description:

      Block invoked when a file is downloading.

      Input Parameters:
      NSData *_Nullable dataFile data.
      NSError *_Nullable errorError experienced during transfer.
      typedef block DJIFileDownloadCompletionBlock
      typedef void (^_Nullable DJIFileDownloadCompletionBlock)()
      Header:DJIPlaybackManager.h
      Description:

      Block invoked after a file has been downloaded.