TUIVideoMessageCellData.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Created by Tencent on 2023/06/09.
  2. // Copyright © 2023 Tencent. All rights reserved.
  3. /**
  4. *
  5. * 1. This file declares the TUIVideoItem class, TUISnapshotItem class, and TUIVideoMessageCellData class.
  6. * - TUIVideoItem corresponds to V2TIMVideoElem in the IM SDK. We convert the classes in the SDK to TUIVideoItem, which is convenient for us to further
  7. * process and operate the data.
  8. * - TUISnapshotItem corresponds to the video cover class in the IM SDK. It is still an image in essence, but is bound to the corresponding Video.
  9. * - TUIVideoMessageCellData inherits from the TUIMessageCellData class and is used to store a series of data and information required by the image message
  10. * unit.
  11. * 2. The business logic for obtaining video information and cover information has been implemented in this document. When you need to get video and cover
  12. * data, you can directly call the relevant member functions declared in this file
  13. */
  14. #import <TIMCommon/TUIBubbleMessageCellData.h>
  15. #import "TUIChatDefine.h"
  16. #import "TUIMessageItem.h"
  17. NS_ASSUME_NONNULL_BEGIN
  18. /////////////////////////////////////////////////////////////////////////////////
  19. //
  20. // TUIVideoMessageCellData
  21. //
  22. /////////////////////////////////////////////////////////////////////////////////
  23. @interface TUIVideoMessageCellData : TUIBubbleMessageCellData <TUIMessageCellDataFileUploadProtocol>
  24. @property(nonatomic, strong) UIImage *thumbImage;
  25. @property(nonatomic, strong) NSString *videoPath;
  26. @property(nonatomic, strong) NSString *snapshotPath;
  27. @property(nonatomic, strong) TUIVideoItem *videoItem;
  28. @property(nonatomic, strong) TUISnapshotItem *snapshotItem;
  29. @property(nonatomic, assign) NSUInteger uploadProgress;
  30. @property(nonatomic, assign) NSUInteger thumbProgress;
  31. @property(nonatomic, assign) NSUInteger videoProgress;
  32. /// Is the current message a custom message
  33. @property(nonatomic, assign) BOOL isPlaceHolderCellData;
  34. + (TUIMessageCellData *)placeholderCellDataWithSnapshotUrl:(NSString *)snapshotUrl thubImage:(UIImage *)thubImage;
  35. - (void)getVideoUrl:(void (^)(NSString *url))urlCallBack;
  36. /**
  37. * Downloading the cover image of the video. It will download from server if the image not exist in local.
  38. */
  39. - (void)downloadThumb;
  40. - (void)downloadThumb:(TUIVideoMessageDownloadCallback)finish;
  41. /**
  42. * Downloading the video file. It will download from server if the video not exist in local.
  43. */
  44. - (void)downloadVideo;
  45. - (BOOL)isVideoExist;
  46. @end
  47. NS_ASSUME_NONNULL_END