JZVideoPlayerView.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. //
  2. // JZVideoPlayerView.h
  3. // aoyouHH
  4. //
  5. // Created by jinzelu on 15/5/29.
  6. // Copyright (c) 2015年 jinzelu. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import <MediaPlayer/MediaPlayer.h>
  10. #import <AVFoundation/AVFoundation.h>
  11. @class JZVideoPlayerView;
  12. @protocol JZPlayerViewDelegate <NSObject>
  13. @optional
  14. -(void)playerViewZoomButtonClicked:(JZVideoPlayerView *)view;
  15. -(void)JZOnBackBtn;
  16. @end
  17. @interface JZVideoPlayerView : UIView
  18. @property(nonatomic, assign) id<JZPlayerViewDelegate> delegate;
  19. //avplayer
  20. @property(nonatomic, strong) AVPlayerItem *playerItem;
  21. @property(nonatomic, strong) AVPlayer *player;
  22. @property(nonatomic, strong) AVPlayerLayer *playerLayer;
  23. @property(nonatomic, strong) NSString *contentStr;
  24. @property(nonatomic, strong) NSURL *contentURL;
  25. @property(nonatomic, assign) BOOL isFullScreen;
  26. @property(nonatomic, assign) BOOL isPlaying;
  27. @property(nonatomic, assign) BOOL playerIsBuffering;
  28. //
  29. @property(nonatomic, strong) UIButton *playBtn;//播放,暂停按钮
  30. @property(nonatomic, strong) UIButton *zoomBtn;//全屏,不全屏按钮
  31. @property(nonatomic, strong) UISlider *progressBar;//播放进度条
  32. @property(nonatomic, strong) UIProgressView *loadProgressView;//缓存进度条
  33. @property(nonatomic, strong) UILabel *playTime;//已播放时间
  34. @property(nonatomic, strong) UILabel *playTotalTime;//总时间
  35. @property(nonatomic, strong) UIButton *backBtn;//返回按钮
  36. @property(nonatomic, strong) UIView *playerHUDBottomView;
  37. @property(nonatomic, strong) UIView *playerHUDTopView;
  38. /**
  39. * NSURL初始化
  40. */
  41. -(id)initWithFrame:(CGRect)frame contentURL:(NSURL *)contentURL;
  42. /**
  43. * 播放
  44. */
  45. -(void)play;
  46. /**
  47. * 暂停
  48. */
  49. -(void)pause;
  50. /**
  51. * 停止
  52. */
  53. -(void)stop;
  54. -(void)resetContentViewWithContentURL:(NSURL *)url;
  55. @end