ZFLandScapeControlView.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. //
  2. // ZFLandScapeControlView.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 "ZFSliderView.h"
  26. #if __has_include(<ZFPlayer/ZFPlayerController.h>)
  27. #import <ZFPlayer/ZFPlayerController.h>
  28. #else
  29. #import "ZFPlayerController.h"
  30. #endif
  31. NS_ASSUME_NONNULL_BEGIN
  32. @interface ZFLandScapeControlView : UIView
  33. /// 顶部工具栏
  34. @property (nonatomic, strong, readonly) UIView *topToolView;
  35. /// 返回按钮
  36. @property (nonatomic, strong, readonly) UIButton *backBtn;
  37. /// 标题
  38. @property (nonatomic, strong, readonly) UILabel *titleLabel;
  39. /// 底部工具栏
  40. @property (nonatomic, strong, readonly) UIView *bottomToolView;
  41. /// 播放或暂停按钮
  42. @property (nonatomic, strong, readonly) UIButton *playOrPauseBtn;
  43. /// 播放的当前时间
  44. @property (nonatomic, strong, readonly) UILabel *currentTimeLabel;
  45. /// 滑杆
  46. @property (nonatomic, strong, readonly) ZFSliderView *slider;
  47. /// 视频总时间
  48. @property (nonatomic, strong, readonly) UILabel *totalTimeLabel;
  49. /// 锁定屏幕按钮
  50. @property (nonatomic, strong, readonly) UIButton *lockBtn;
  51. /// 播放器
  52. @property (nonatomic, weak) ZFPlayerController *player;
  53. /// slider滑动中
  54. @property (nonatomic, copy, nullable) void(^sliderValueChanging)(CGFloat value,BOOL forward);
  55. /// slider滑动结束
  56. @property (nonatomic, copy, nullable) void(^sliderValueChanged)(CGFloat value);
  57. /// 返回按钮点击回调
  58. @property (nonatomic, copy) void(^backBtnClickCallback)(void);
  59. /// 如果是暂停状态,seek完是否播放,默认YES
  60. @property (nonatomic, assign) BOOL seekToPlay;
  61. /// 重置控制层
  62. - (void)resetControlView;
  63. /// 显示控制层
  64. - (void)showControlView;
  65. /// 隐藏控制层
  66. - (void)hideControlView;
  67. /// 设置播放时间
  68. - (void)videoPlayer:(ZFPlayerController *)videoPlayer currentTime:(NSTimeInterval)currentTime totalTime:(NSTimeInterval)totalTime;
  69. /// 设置缓冲时间
  70. - (void)videoPlayer:(ZFPlayerController *)videoPlayer bufferTime:(NSTimeInterval)bufferTime;
  71. /// 是否响应该手势
  72. - (BOOL)shouldResponseGestureWithPoint:(CGPoint)point withGestureType:(ZFPlayerGestureType)type touch:(nonnull UITouch *)touch;
  73. /// 视频尺寸改变
  74. - (void)videoPlayer:(ZFPlayerController *)videoPlayer presentationSizeChanged:(CGSize)size;
  75. /// 标题和全屏模式
  76. - (void)showTitle:(NSString *_Nullable)title fullScreenMode:(ZFFullScreenMode)fullScreenMode;
  77. /// 根据当前播放状态取反
  78. - (void)playOrPause;
  79. /// 播放按钮状态
  80. - (void)playBtnSelectedState:(BOOL)selected;
  81. /// 调节播放进度slider和当前时间更新
  82. - (void)sliderValueChanged:(CGFloat)value currentTimeString:(NSString *)timeString;
  83. /// 滑杆结束滑动
  84. - (void)sliderChangeEnded;
  85. @end
  86. NS_ASSUME_NONNULL_END