JXShortDramaCell.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. //
  2. // JXShortDramaCell.h
  3. // AICity
  4. //
  5. // Created by TogetherWatch on 2025-10-20.
  6. // Feature: 010-ui-ios - 短剧播放Cell
  7. // 对标Android: ShortDramaSuperPlayerAdapter.SuperPlayerViewHolder
  8. //
  9. #import <UIKit/UIKit.h>
  10. @class JXDramaContent;
  11. #import "JXSuperPlayer.h"
  12. NS_ASSUME_NONNULL_BEGIN
  13. /**
  14. * 短剧播放Cell回调协议
  15. */
  16. @protocol JXShortDramaCellDelegate <NSObject>
  17. @optional
  18. - (void)shortDramaCellDidTapLike:(UICollectionViewCell *)cell;
  19. - (void)shortDramaCellDidTapFavorite:(UICollectionViewCell *)cell;
  20. - (void)shortDramaCellDidTapComment:(UICollectionViewCell *)cell;
  21. - (void)shortDramaCellDidTapCollection:(UICollectionViewCell *)cell;
  22. - (void)shortDramaCellDidTapDetail:(UICollectionViewCell *)cell;
  23. - (void)shortDramaCellDidFailToPlay:(UICollectionViewCell *)cell;
  24. @end
  25. /**
  26. * 短剧垂直滑动播放Cell
  27. *
  28. * 功能:
  29. * - 集成SuperPlayer播放DRM视频
  30. * - 显示交互按钮(点赞、收藏、评论、合集)
  31. * - 显示短剧信息(标题、描述、作者)
  32. * - 支持手势交互
  33. *
  34. * 对标Android: ShortDramaSuperPlayerAdapter.SuperPlayerViewHolder
  35. */
  36. @interface JXShortDramaCell : UICollectionViewCell
  37. @property (nonatomic, weak) id<JXShortDramaCellDelegate> delegate;
  38. @property (nonatomic, assign, readonly) JXSuperPlayerState playerState;
  39. /**
  40. * 配置Cell数据
  41. */
  42. - (void)configureWithDrama:(JXDramaContent *)drama;
  43. /**
  44. * 播放控制
  45. */
  46. - (void)startPlay;
  47. - (void)stopPlay;
  48. - (void)pausePlay;
  49. - (void)resumePlay;
  50. /**
  51. * 更新交互UI
  52. */
  53. - (void)updateLikeUI:(BOOL)isLiked count:(long long)count;
  54. - (void)updateFavoriteUI:(BOOL)isFavorited count:(long long)count;
  55. - (void)updateCommentCount:(long long)count;
  56. /**
  57. * 更新点赞和收藏数量(与ViewController匹配)
  58. */
  59. - (void)updateLikeCount:(NSInteger)likeCount isLiked:(BOOL)isLiked;
  60. - (void)updateFavoriteCount:(NSInteger)favoriteCount isFavorited:(BOOL)isFavorited;
  61. /**
  62. * 格式化数字显示(如 1000 -> 1K)
  63. */
  64. + (NSString *)formattedCountWithCount:(long long)count;
  65. @end
  66. NS_ASSUME_NONNULL_END