IMSDK
IM features a comprehensive suite of solutions including global access, one-to-one chat, group chat, message push, profile and relationship chain hosting, and account authentication. It also provides complete app access and backend management APIs.
V2TIMVideoElem

Instance Methods

(void) - getVideoUrl:
 
(void) - getSnapshotUrl:
 
(void) - downloadVideo:progress:succ:fail:
 
(void) - downloadSnapshot:progress:succ:fail:
 
(V2TIMElem *) - nextElem
 
(void) - appendElem:
 

Properties

NSString * videoPath
 
NSString * snapshotPath
 
NSString * videoUUID
 
int videoSize
 
NSString * videoType
 
int duration
 
NSString * snapshotUUID
 
int snapshotSize
 
int snapshotWidth
 
int snapshotHeight
 

Method Documentation

◆ getVideoUrl:()

- (void) getVideoUrl: (void(^)(NSString *url))  urlCallBack

Get the video download URL.

◆ getSnapshotUrl:()

- (void) getSnapshotUrl: (void(^)(NSString *url))  urlCallBack

Get the screenshot download URL.

◆ downloadVideo:progress:succ:fail:()

- (void) downloadVideo: (NSString *)  path
progress: (V2TIMDownLoadProgress)  progress
succ: (V2TIMSucc)  succ
fail: (V2TIMFail)  fail 

Download a video. This API downloads data from the server. To cache or store the data, you can use the UUID as the key. The Chat SDK does not store the files.

Parameters
pathThe path to which the video file is saved. It must be specified externally.

◆ downloadSnapshot:progress:succ:fail:()

- (void) downloadSnapshot: (NSString *)  path
progress: (V2TIMDownLoadProgress)  progress
succ: (V2TIMSucc)  succ
fail: (V2TIMFail)  fail 

Download a video screenshot. This API downloads data from the server. To cache or store the data, you can use the UUID as the key. The Chat SDK does not store the files.

Parameters
pathThe path to which the screenshot file is saved. It must be specified externally.

◆ nextElem()

- (V2TIMElem *) nextElem

Get the next Elem. If your message has multiple Elems, you can get the next Elem object from the current Elem. If the return value is nil, it means the Elem acquisition is over. For detailed usage, please refer to the document Message sending and receiving

◆ appendElem:()

- (void) appendElem: (V2TIMElem *)  elem

Add the next element
To configure multiple elements, after creating a Message object, you can add the next element via the element object of Message. The following is the sample code for creating V2TIMTextElem and V2TIMCustomElem:

    V2TIMMessage *msg = [[V2TIMManager sharedInstance] createTextMessage:"text"];
    V2TIMCustomElem *customElem = [[V2TIMCustomElem alloc] init];
    customElem.data = ["自定义消息" dataUsingEncoding:NSUTF8StringEncoding];
    [msg.textElem appendElem:customElem];
Attention
  • This API can be called only by elements of a Message object created via createMessage.
  • This API can be used to add V2TIMTextElem, V2TIMCustomElem, V2TIMFaceElem, or V2TIMLocationElem.

Property Documentation

◆ videoPath

- (NSString*) videoPath
readnonatomicstrong

The video file path (can only be called by the message sender)

◆ snapshotPath

- (NSString*) snapshotPath
readnonatomicstrong

The path of the screenshot file (can only be called by the message sender)

◆ videoUUID

- (NSString*) videoUUID
readnonatomicstrong

The internal video ID, which can be used as the key for external caching.

◆ videoSize

- (int) videoSize
readnonatomicassign

Video file size.

◆ videoType

- (NSString*) videoType
readnonatomicstrong

Video type.

◆ duration

- (int) duration
readnonatomicassign

Duration, in seconds.

◆ snapshotUUID

- (NSString*) snapshotUUID
readnonatomicstrong

The internal screenshot ID, which can be used as the key for external caching.

◆ snapshotSize

- (int) snapshotSize
readnonatomicassign

Screenshot file size.

◆ snapshotWidth

- (int) snapshotWidth
readnonatomicassign

Screenshot width.

◆ snapshotHeight

- (int) snapshotHeight
readnonatomicassign

Screenshot height.