VIResourceLoadingRequestWorker.h 901 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // VIResourceLoadingRequestWorker.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. @class VIMediaDownloader, AVAssetResourceLoadingRequest;
  10. @protocol VIResourceLoadingRequestWorkerDelegate;
  11. @interface VIResourceLoadingRequestWorker : NSObject
  12. - (instancetype)initWithMediaDownloader:(VIMediaDownloader *)mediaDownloader resourceLoadingRequest:(AVAssetResourceLoadingRequest *)request;
  13. @property (nonatomic, weak) id<VIResourceLoadingRequestWorkerDelegate> delegate;
  14. @property (nonatomic, strong, readonly) AVAssetResourceLoadingRequest *request;
  15. - (void)startWork;
  16. - (void)cancel;
  17. - (void)finish;
  18. @end
  19. @protocol VIResourceLoadingRequestWorkerDelegate <NSObject>
  20. - (void)resourceLoadingRequestWorker:(VIResourceLoadingRequestWorker *)requestWorker didCompleteWithError:(NSError *)error;
  21. @end