ZFPlayerControlView2.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. //
  2. // ZFPlayerControlView.h
  3. // ZFPlayer
  4. //
  5. // Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng )
  6. //
  7. // Permission is hereby granted, free of charge, to any person obtaining a copy
  8. // of this software and associated documentation files (the "Software"), to deal
  9. // in the Software without restriction, including without limitation the rights
  10. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11. // copies of the Software, and to permit persons to whom the Software is
  12. // furnished to do so, subject to the following conditions:
  13. //
  14. // The above copyright notice and this permission notice shall be included in
  15. // all copies or substantial portions of the Software.
  16. //
  17. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  23. // THE SOFTWARE.
  24. #import <UIKit/UIKit.h>
  25. #import "ZFPortraitControlView2.h"
  26. //#import "ZFLandScapeControlView.h"
  27. #import "ZFSpeedLoadingView.h"
  28. #import "ZFSmallFloatControlView.h"
  29. #if __has_include(<ZFPlayer/ZFPlayerMediaControl.h>)
  30. #import <ZFPlayer/ZFPlayerMediaControl.h>
  31. #else
  32. #import "ZFPlayerMediaControl.h"
  33. #endif
  34. #import "ZFLandScapeControlView2.h"
  35. @interface ZFPlayerControlView2 : UIView <ZFPlayerMediaControl>
  36. /// 竖屏控制层的View
  37. @property (nonatomic, strong, readonly) ZFPortraitControlView2 * _Nullable portraitControlView;
  38. /// 横屏控制层的View
  39. @property (nonatomic, strong, readonly) ZFLandScapeControlView2 * _Nullable landScapeControlView;
  40. /// 加载loading
  41. @property (nonatomic, strong, readonly) ZFSpeedLoadingView * _Nullable activity;
  42. /// 快进快退View
  43. @property (nonatomic, strong, readonly) UIView * _Nullable fastView;
  44. /// 快进快退进度progress
  45. @property (nonatomic, strong, readonly) ZFSliderView * _Nullable fastProgressView;
  46. /// 快进快退时间
  47. @property (nonatomic, strong, readonly) UILabel * _Nullable fastTimeLabel;
  48. /// 快进快退ImageView
  49. @property (nonatomic, strong, readonly) UIImageView * _Nullable fastImageView;
  50. /// 加载失败按钮
  51. @property (nonatomic, strong, readonly) UIButton * _Nullable failBtn;
  52. /// 底部播放进度
  53. @property (nonatomic, strong, readonly) ZFSliderView * _Nullable bottomPgrogress;
  54. /// 封面图
  55. @property (nonatomic, strong, readonly) UIImageView * _Nullable coverImageView;
  56. /// 高斯模糊的背景图
  57. @property (nonatomic, strong, readonly) UIImageView * _Nullable bgImgView;
  58. /// 高斯模糊视图
  59. @property (nonatomic, strong, readonly) UIView * _Nullable effectView;
  60. /// 小窗口控制层
  61. @property (nonatomic, strong, readonly) ZFSmallFloatControlView * _Nullable floatControlView;
  62. /// 快进视图是否显示动画,默认NO.
  63. @property (nonatomic, assign) BOOL fastViewAnimated;
  64. /// 视频之外区域是否高斯模糊显示,默认YES.
  65. @property (nonatomic, assign) BOOL effectViewShow;
  66. /// 如果是暂停状态,seek完是否播放,默认YES
  67. @property (nonatomic, assign) BOOL seekToPlay;
  68. /// 返回按钮点击回调
  69. @property (nonatomic, copy) void(^ _Nullable backBtnClickCallback)(void);
  70. /// 倍速按钮点击回调
  71. @property (nonatomic, copy) void(^ _Nullable speedBtnClickCallback)(CGFloat sp);
  72. /// 清晰度按钮点击回调
  73. @property (nonatomic, copy) void(^ _Nullable pBtnClickCallback)(NSInteger index,int currentSecond);
  74. /// 下一集
  75. @property (nonatomic, copy) void(^ _Nonnull nextBtnClickCallback)(void);
  76. /// 点击返回按钮
  77. @property (nonatomic, copy, nullable) void(^clickBackBlock)(void);
  78. /// 控制层显示或者隐藏
  79. @property (nonatomic, readonly) BOOL controlViewAppeared;
  80. /// 控制层显示或者隐藏的回调
  81. @property (nonatomic, copy) void(^ _Nullable controlViewAppearedCallback)(BOOL appeared);
  82. /// 控制层自动隐藏的时间,默认2.5秒
  83. @property (nonatomic, assign) NSTimeInterval autoHiddenTimeInterval;
  84. /// 控制层显示、隐藏动画的时长,默认0.25秒
  85. @property (nonatomic, assign) NSTimeInterval autoFadeTimeInterval;
  86. /// 横向滑动控制播放进度时是否显示控制层,默认 YES.
  87. @property (nonatomic, assign) BOOL horizontalPanShowControlView;
  88. /// prepare时候是否显示控制层,默认 NO.
  89. @property (nonatomic, assign) BOOL prepareShowControlView;
  90. /// prepare时候是否显示loading,默认 NO.
  91. @property (nonatomic, assign) BOOL prepareShowLoading;
  92. /// 是否自定义禁止pan手势,默认 NO.
  93. @property (nonatomic, assign) BOOL customDisablePanMovingDirection;
  94. /// 横屏时候是否显示自定义状态栏(iOS13+),默认 NO.
  95. @property (nonatomic, assign) BOOL showCustomStatusBar;
  96. /// 全屏模式
  97. @property (nonatomic, assign) ZFFullScreenMode fullScreenMode;
  98. /**
  99. 设置标题、封面、全屏模式
  100. @param title 视频的标题
  101. @param coverUrl 视频的封面,占位图默认是灰色的
  102. @param fullScreenMode 全屏模式
  103. */
  104. - (void)showTitle:(NSString *_Nullable)title coverURLString:(NSString *_Nullable)coverUrl fullScreenMode:(ZFFullScreenMode)fullScreenMode;
  105. /**
  106. 设置标题、封面、默认占位图、全屏模式
  107. @param title 视频的标题
  108. @param coverUrl 视频的封面
  109. @param placeholder 指定封面的placeholder
  110. @param fullScreenMode 全屏模式
  111. */
  112. - (void)showTitle:(NSString * _Nullable)title coverURLString:(NSString * _Nullable)coverUrl placeholderImage:(UIImage * _Nullable)placeholder fullScreenMode:(ZFFullScreenMode)fullScreenMode;
  113. /**
  114. 设置标题、UIImage封面、全屏模式
  115. @param title 视频的标题
  116. @param image 视频的封面UIImage
  117. @param fullScreenMode 全屏模式
  118. */
  119. - (void)showTitle:(NSString * _Nullable)title coverImage:(UIImage * _Nullable)image fullScreenMode:(ZFFullScreenMode)fullScreenMode;
  120. //- (void)showFullScreen
  121. /**
  122. 重置控制层
  123. */
  124. - (void)resetControlView;
  125. @end