SVGAVideoEntity.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // SVGAVideoEntity.h
  3. // SVGAPlayer
  4. //
  5. // Created by 崔明辉 on 16/6/17.
  6. // Copyright © 2016年 UED Center. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. @class SVGAVideoEntity, SVGAVideoSpriteEntity, SVGAVideoSpriteFrameEntity, SVGABitmapLayer, SVGAVectorLayer, SVGAAudioEntity;
  11. @class SVGAProtoMovieEntity;
  12. @interface SVGAVideoEntity : NSObject
  13. @property (nonatomic, readonly) CGSize videoSize;
  14. @property (nonatomic, readonly) int FPS;
  15. @property (nonatomic, readonly) int frames;
  16. @property (nonatomic, readonly) NSDictionary<NSString *, UIImage *> *images;
  17. @property (nonatomic, readonly) NSDictionary<NSString *, NSData *> *audiosData;
  18. @property (nonatomic, readonly) NSArray<SVGAVideoSpriteEntity *> *sprites;
  19. @property (nonatomic, readonly) NSArray<SVGAAudioEntity *> *audios;
  20. - (instancetype)initWithJSONObject:(NSDictionary *)JSONObject cacheDir:(NSString *)cacheDir;
  21. - (void)resetImagesWithJSONObject:(NSDictionary *)JSONObject;
  22. - (void)resetSpritesWithJSONObject:(NSDictionary *)JSONObject;
  23. - (instancetype)initWithProtoObject:(SVGAProtoMovieEntity *)protoObject cacheDir:(NSString *)cacheDir;
  24. - (void)resetImagesWithProtoObject:(SVGAProtoMovieEntity *)protoObject;
  25. - (void)resetSpritesWithProtoObject:(SVGAProtoMovieEntity *)protoObject;
  26. - (void)resetAudiosWithProtoObject:(SVGAProtoMovieEntity *)protoObject;
  27. + (SVGAVideoEntity *)readCache:(NSString *)cacheKey;
  28. // NSCache缓存
  29. - (void)saveCache:(NSString *)cacheKey;
  30. // NSMapTable弱缓存
  31. - (void)saveWeakCache:(NSString *)cacheKey;
  32. - (void)clearCache:(NSString *)cacheKey;
  33. + (void)clearCache:(NSString *)cacheKey;
  34. @end