UIView+addVideoToView.h 610 B

123456789101112131415161718192021222324
  1. //
  2. // UIView+addVideoToView.h
  3. // 扩展Demo
  4. //
  5. // Created by Hello on 2018/4/19.
  6. // Copyright © 2018年 Hello. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import <AVFoundation/AVFoundation.h>
  10. @interface UIView (addVideoToView)
  11. /**
  12. 添加视频视图
  13. @param frame 视图大小位置
  14. @param url 视频网络链接
  15. @param block 返回AVPlayer,用于暂停、播放、获取播放进度、调节播放进度
  16. 在block中需要主动开启AVPlayer播放
  17. */
  18. -(void)addVideoWithPlayerLayerFrame:(CGRect)frame withPlayerItemUrlString:(NSString *)url complete:(void(^)(AVPlayer *player))block;
  19. @end