DJICamera
@interface DJICamera : DJIBaseComponent
This class contains the media manager and playback manager to manage the Camera’s media content. It provides methods to change camera settings and perform camera actions.
-
Delegate that recevies the information sent by the camera.
Declaration
Objective-C
@property (readwrite, nonatomic) id<DJICameraDelegate> _Nullable delegate; -
String that represents name of the camera.
Declaration
Objective-C
@property (readonly, nonatomic) NSString *_Nonnull displayName; -
Media Manager is used for interaction when camera is in
DJICameraModeMediaDownload. The user can only access the manager whenisMediaDownloadModeSupportedreturnsYES.Declaration
Objective-C
@property (readonly, nonatomic) DJIMediaManager *_Nullable mediaManager; -
Playback Manager is used for interaction when camera is in
DJICameraModePlayback. User can only access to the manager when isPlaybackSupported returns YES.Declaration
Objective-C
@property (readonly, nonatomic) DJIPlaybackManager *_Nullable playbackManager;
-
Sets the camera’s work mode to taking pictures, video, playback or download (see DJICameraMode) for details on camera work modes. Note that you cannot change the mode when a certain task is executing, such as taking photo(s), recording video, or downloading and saving files. Also supported by thermal imaging camera.
Declaration
Objective-C
- (void)setCameraMode:(DJICameraMode)mode withCompletion:(DJICompletionBlock)block;Parameters
modeCamera work mode.
blockRemote execution result error block.
-
Gets the camera’s current work mode. Also supported by thermal imaging camera.
Declaration
Objective-C
- (void)getCameraModeWithCompletion:(void (^_Nonnull)(DJICameraMode, NSError *_Nullable))block;Parameters
blockRemote execution result callback block.
-
Check if the current device supports time-lapse shoot mode. Supported only on the Osmo camera.
Declaration
Objective-C
- (BOOL)isTimeLapseSupported; -
Camera starts to take photo with one of the camera capture modes (shoot photo modes).
Preconditions:
- Camera must be in ShootPhoto mode.
- The SD card state should be checked before this method is used to ensure sufficient space exists.
Note that if the capture mode is Interval or Time-lapse, calling
stopShootPhotomay be required for the camera to stop taking photos. Also supported by thermal imaging camera.Declaration
Objective-C
- (void)startShootPhoto:(DJICameraShootPhotoMode)shootMode withCompletion:(DJICompletionBlock)block;Parameters
shootModeShoot photo mode with which the camera can start taking photos. See CameraShootPhotoMode to view all possible camera shoot modes.
blockThe execution callback with the returned execution result.
-
Camera stops taking photos.
Preconditions:
startShootPhoto:withCompletion:has been invoked and the shoot mode is either Interval or Time-lapse.- The shoot photo operation is still executing.
Also supported by thermal imaging camera.
Declaration
Objective-C
- (void)stopShootPhotoWithCompletion:(DJICompletionBlock)block;Parameters
blockThe execution callback with the returned execution result.
-
YESif current device supports Slow Motion video recording. Currently Slow Motion is supported by the Osmo X3/Z3 camera, the Phantom 4 camera and the Mavic Pro camera. Note, while P4P, X4S and X5S can record at high frame-rates, the video playback will be in realtime. There are two ways to enter Slow Motion mode:- Call
setVideoSlowMotionEnabled:withCompletion:with YES. - Call
setVideoResolution:andFrameRate:withCompletion:withDJICameraVideoResolution1920x1080andDJICameraVideoFrameRate120FPSfor the X3 camera or the Phantom 4 camera. CallsetVideoResolution:andFrameRate:withCompletion:withDJICameraVideoResolution1920x1080andDJICameraVideoFrameRate96FPSorDJICameraVideoResolution1280x720andDJICameraVideoFrameRate120FPSfor the Mavic Pro camera.
Declaration
Objective-C
- (BOOL)isSlowMotionSupported; - Call
-
Enables/Disables Slow Motion video recording. When it is enabled, the frame rate will change to 120fps. When it is disabled, the resolution and frame rate will revert to the previous setting for Osmo, while for the Phantom 4 camera or the Mavic Pro camera, the resolution will remain at
DJICameraVideoResolution1920x1080and the frame rate will change toDJICameraVideoFrameRate47dot950FPS.Declaration
Objective-C
- (void)setVideoSlowMotionEnabled:(BOOL)enabled withCompletion:(DJICompletionBlock)block;Parameters
enabledEnable or disable Slow Motion video.
blockThe execution callback with the returned execution result.
-
Determines whether Slow Motion mode is enabled. Supported only by the Osmo camera.
Declaration
Objective-C
- (void)getVideoSlowMotionEnabledWithCompletion: (void (^_Nonnull)(BOOL, NSError *_Nullable))block;Parameters
blockThe execution callback with the returned value(s).
-
Starts recording video. The camera must be in
DJICameraModeRecordVideowork mode. Also supported by thermal imaging camera.Declaration
Objective-C
- (void)startRecordVideoWithCompletion:(DJICompletionBlock)block; -
Stops recording video. Also supported by thermal imaging camera.
Declaration
Objective-C
- (void)stopRecordVideoWithCompletion:(DJICompletionBlock)block;
View on GitHub
DJICamera Class Reference