VIResourceLoader.h 725 B

12345678910111213141516171819202122232425262728293031
  1. //
  2. // VIResoureLoader.h
  3. // VIMediaCacheDemo
  4. //
  5. // Created by Vito on 4/21/16.
  6. // Copyright © 2016 Vito. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @import AVFoundation;
  10. @protocol VIResourceLoaderDelegate;
  11. @interface VIResourceLoader : NSObject
  12. @property (nonatomic, strong, readonly) NSURL *url;
  13. @property (nonatomic, weak) id<VIResourceLoaderDelegate> delegate;
  14. - (instancetype)initWithURL:(NSURL *)url;
  15. - (void)addRequest:(AVAssetResourceLoadingRequest *)request;
  16. - (void)removeRequest:(AVAssetResourceLoadingRequest *)request;
  17. - (void)cancel;
  18. @end
  19. @protocol VIResourceLoaderDelegate <NSObject>
  20. - (void)resourceLoader:(VIResourceLoader *)resourceLoader didFailWithError:(NSError *)error;
  21. @end