XYPlayPAGView.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // XYPlayPAGView.h
  3. // Timi
  4. //
  5. // Created by 翟玉磊 on 2021/12/28.
  6. //
  7. #import <UIKit/UIKit.h>
  8. #include <libpag/PAGView.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. typedef enum : NSUInteger {
  11. // 送礼昵称 打赏
  12. XYPlayPAGReplaceTextContentTypeComboTitle = 1,
  13. // 收礼昵称 礼物名称 x20
  14. XYPlayPAGReplaceTextContentTypeComboSubtitle = 0,
  15. } XYPlayPAGReplaceTextContentType;
  16. typedef enum : NSUInteger {
  17. // 礼物图标
  18. XYPlayPAGReplaceImageContentTypeComboGiftIcon = 1,
  19. // 礼物连击发送者头像/首页导航守护发送者头像
  20. XYPlayPAGReplaceImageContentTypeComboSenderIcon = 3,
  21. // 礼物连击接受者头像/首页导航守护接受者头像
  22. XYPlayPAGReplaceImageContentTypeComboReceiverIcon = 2,
  23. } XYPlayPAGReplaceImageContentType;
  24. @interface XYPlayPAGView : UIView
  25. /// 设置动画资源路径且是否播放
  26. /// @param fileName 资源文件
  27. /// @param play 是否播放
  28. - (void)setResourcePathWithFileName:(NSString *)fileName play:(BOOL)play;
  29. /// 设置动画资源路径
  30. - (void)setResourcePathWithFileName:(NSString *)fileName;
  31. /// 设置播放次数 -1则无限播放 默认-1
  32. - (void)setRepeatCount:(int)repeatCount;
  33. /// 动画视图显示方式 拉伸,平铺、、
  34. - (void)setScaleMode:(PAGScaleMode)value;
  35. /// 替换文本
  36. - (void)replaceText:(XYPlayPAGReplaceTextContentType)type text:(NSString *)text;
  37. /// 替换图片
  38. - (void)replaceImage:(XYPlayPAGReplaceImageContentType)type image:(UIImage *)image;
  39. /// 当前播放状态
  40. - (BOOL)isPlaying;
  41. /// 播放
  42. - (void)play;
  43. /// 暂停
  44. - (void)stop;
  45. /// 注销
  46. - (void)clear;
  47. @end
  48. NS_ASSUME_NONNULL_END