YBIBVideoData.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // YBIBVideoData.h
  3. // YBImageBrowserDemo
  4. //
  5. // Created by 波儿菜 on 2019/7/10.
  6. // Copyright © 2019 杨波. All rights reserved.
  7. //
  8. #import <Photos/Photos.h>
  9. #import "YBIBDataProtocol.h"
  10. #import "YBIBInteractionProfile.h"
  11. NS_ASSUME_NONNULL_BEGIN
  12. @class YBIBVideoData;
  13. /// 单击事件的处理闭包
  14. typedef void (^YBIBVideoSingleTouchBlock)(YBIBVideoData *videoData);
  15. /**
  16. 图片数据类,承担配置数据和处理数据的责任
  17. */
  18. @interface YBIBVideoData : NSObject <YBIBDataProtocol>
  19. /// 视频 URL
  20. @property (nonatomic, copy, nullable) NSURL *videoURL;
  21. /// 相册视频资源
  22. @property (nonatomic, strong, nullable) PHAsset *videoPHAsset;
  23. /// 视频 AVAsset (通常使用 AVURLAsset)
  24. @property (nonatomic, strong, nullable) AVAsset *videoAVAsset;
  25. /// 投影视图,当前数据模型对应外界业务的 UIView (通常为 UIImageView),做转场动效用
  26. @property (nonatomic, weak, nullable) __kindof UIView *projectiveView;
  27. /// 预览图/缩约图,若 projectiveView 存在且是 UIImageView 类型将会自动获取缩约图
  28. @property (nonatomic, strong, nullable) UIImage *thumbImage;
  29. /// 是否允许保存到相册
  30. @property (nonatomic, assign) BOOL allowSaveToPhotoAlbum;
  31. /// 自动播放次数,默认为 0,NSUIntegerMax 表示无限次
  32. @property (nonatomic, assign) NSUInteger autoPlayCount;
  33. /// 重复播放次数,默认为 0,NSUIntegerMax 表示无限次
  34. @property (nonatomic, assign) NSUInteger repeatPlayCount;
  35. /// 预留属性可随意使用
  36. @property (nonatomic, strong, nullable) id extraData;
  37. /// 手势交互动效配置文件
  38. @property (nonatomic, strong) YBIBInteractionProfile *interactionProfile;
  39. /// 单击的处理(视频未播放时),默认是退出图片浏览器
  40. @property (nonatomic, copy, nullable) YBIBVideoSingleTouchBlock singleTouchBlock;
  41. /// 是否要隐藏播放时的叉叉(取消)按钮
  42. @property (nonatomic, assign) BOOL shouldHideForkButton;
  43. @end
  44. NS_ASSUME_NONNULL_END