TBVideoRequestTask.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // TBVideoRequestTask.h
  3. // avplayerSavebufferData
  4. //
  5. // Created by qianjianeng on 15/9/18.
  6. // Copyright (c) 2015年 qianjianeng. All rights reserved.
  7. //
  8. //// github地址:https://github.com/suifengqjn/TBPlayer
  9. /// 这个task的功能是从网络请求数据,并把数据保存到本地的一个临时文件,网络请求结束的时候,如果数据完整,则把数据缓存到指定的路径,不完整就删除
  10. #import <Foundation/Foundation.h>
  11. #import <AVFoundation/AVFoundation.h>
  12. @class TBVideoRequestTask;
  13. @protocol TBVideoRequestTaskDelegate <NSObject>
  14. - (void)task:(TBVideoRequestTask *)task didReceiveVideoLength:(NSUInteger)ideoLength mimeType:(NSString *)mimeType;
  15. - (void)didReceiveVideoDataWithTask:(TBVideoRequestTask *)task;
  16. - (void)didFinishLoadingWithTask:(TBVideoRequestTask *)task;
  17. - (void)didFailLoadingWithTask:(TBVideoRequestTask *)task WithError:(NSInteger )errorCode;
  18. @end
  19. @interface TBVideoRequestTask : NSObject
  20. @property (nonatomic, strong, readonly) NSURL *url;
  21. @property (nonatomic, readonly ) NSUInteger offset;
  22. @property (nonatomic, readonly ) NSUInteger videoLength;
  23. @property (nonatomic, readonly ) NSUInteger downLoadingOffset;
  24. @property (nonatomic, strong, readonly) NSString * mimeType;
  25. @property (nonatomic, assign) BOOL isFinishLoad;
  26. @property (nonatomic, weak ) id <TBVideoRequestTaskDelegate> delegate;
  27. - (void)setUrl:(NSURL *)url offset:(NSUInteger)offset;
  28. - (void)cancel;
  29. - (void)continueLoading;
  30. - (void)clearData;
  31. @end