YOUPAIRCDDanmakuManager.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. // YOUPAIRCDDanmakuManager.h
  3. // DanMuDemo
  4. //
  5. // Created by Sin on 16/9/26.
  6. // Copyright © 2016年 Sin. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #define RCDanmakuManager [YOUPAIRCDDanmakuManager sharedManager]
  10. @interface YOUPAIRCDDanmakuManager : NSObject
  11. + (instancetype)sharedManager;
  12. - (void)reset;
  13. @property (nonatomic, assign) BOOL isPlaying;
  14. // 以下属性都是必须配置的--------//
  15. // 弹幕动画时间
  16. @property (nonatomic, assign) CGFloat duration;
  17. // 中间上边/下边弹幕动画时间
  18. @property (nonatomic, assign) CGFloat centerDuration;
  19. // 特定位置弹幕的持续时间
  20. @property (nonatomic, assign) CGFloat specialDuration;
  21. // 弹幕弹道高度
  22. @property (nonatomic, assign) CGFloat lineHeight;
  23. // 弹幕弹道之间的间距
  24. @property (nonatomic, assign) CGFloat lineMargin;
  25. // 弹幕弹道最大行数
  26. @property (nonatomic, assign) NSInteger maxShowLineCount;
  27. // 弹幕弹道中间上边/下边最大行数
  28. @property (nonatomic, assign) NSInteger maxCenterLineCount;
  29. //是否允许过量加载弹幕,如果为yes,那么不做弹幕缓存,来多少弹幕,就直接加载多少
  30. //如果做缓存,弹幕会以固定的时间弹出,整个屏幕最多显示maxShowLineCount条弹幕
  31. @property (nonatomic,assign) BOOL isAllowOverLoad;
  32. // 以上属性都是必须配置的--------//
  33. //弹幕缓存的计时器,如果允许过量加载弹幕,该定时器无效
  34. @property(nonatomic, strong) NSTimer *timer;
  35. //所有弹幕的数组
  36. @property(nonatomic, strong) NSMutableArray* danmakus;
  37. //所有弹幕info的数组
  38. @property(nonatomic, strong) NSMutableArray* subDanmakuInfos;
  39. //当前页面上显示的弹幕所在的label的数组
  40. @property(nonatomic, strong) NSMutableArray *currentDanmakuCache;
  41. //从右往左的弹幕的弹道的路径字典
  42. @property(nonatomic, strong) NSMutableDictionary* linesDict;
  43. //居中靠上的弹幕的弹道的路径字典
  44. @property(nonatomic, strong) NSMutableDictionary* centerTopLinesDict;
  45. //居中靠下的弹幕的弹道的路径字典
  46. @property(nonatomic, strong) NSMutableDictionary* centerBottomLinesDict;
  47. @end