DJIMedia
@interface DJIMedia : NSObject
This class contains information about a multi-media file on the SD card. It also provides methods to retrieve the data in the file.
-
Returns the name of the media file.
Declaration
Objective-C
@property (readonly, nonatomic) NSString *_Nonnull fileName; -
Returns the size, in bytes, of the media file.
Declaration
Objective-C
@property (readonly, nonatomic) long long fileSizeInBytes; -
Returns the time when the media file was created as a string in the format
yyyy-MM-dd HH:mm:ss
.Declaration
Objective-C
@property (readonly, nonatomic) NSString *_Nonnull timeCreated; -
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.
Declaration
Objective-C
@property (readonly, nonatomic) float durationInSeconds; -
Returns the type of media file.
Declaration
Objective-C
@property (readonly, nonatomic) DJIMediaType mediaType; -
Returns the thumbnail for this media. If this property returns nil, call
fetchThumbnailWithCompletion.Declaration
Objective-C
@property (readonly, nonatomic) UIImage *_Nullable thumbnail; -
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
DJICameraOrientationLandscapeif the media file is a photo. Only Mavic Pro supports this property. Will beDJICameraOrientationLandscapefor other products.Declaration
Objective-C
@property (readonly, nonatomic) DJICameraOrientation videoOrientation; -
Fetches this media’s thumbnail from the SD card. This method can be used to fetch either a photo or a video, where the first frame of the video is the thumbnail that is fetched. It is not available if the media type is
DJIMediaTypePanorama.Declaration
Objective-C
- (void)fetchThumbnailWithCompletion:(DJICompletionBlock)block;Parameters
blockCompletion block.
-
Fetches this media’s 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.
Declaration
Objective-C
- (void)fetchMediaDataWithCompletion: (void (^_Nonnull)(NSData *_Nullable, BOOL *_Nullable, NSError *_Nullable))block;Parameters
blockData callback will be invoked when media data has been received from the SD card or an error has occurred.
-
Fetch media’s preview image. The preview image is a lower resolution (960 x 540) version of a still picture or the first frame of a video. The
mediaTypeof this media object should be ‘DJIMediaTypeJPG’. It is not available if the media type isDJIMediaTypePanorama.Declaration
Objective-C
- (void)fetchPreviewImageWithCompletion: (void (^_Nonnull)(UIImage *_Nonnull, NSError *_Nullable))block;Parameters
blockRemote execute result callback.
-
Fetch sub media files. This is available only when the media type is
DJIMediaTypePanorama. Call this method to fetch the set of photos shot in a panorama mission.Declaration
Objective-C
- (void)fetchSubMediaFileListWithCompletion: (void (^_Nonnull)(NSArray<DJIMedia *> *_Nullable, NSError *_Nullable))block;Parameters
blockRemote execute result callback.
View on GitHub
DJIMedia Class Reference