VODUploadSVideoClient.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. //
  2. // VODUploadSimpleClient.h
  3. // VODUpload
  4. //
  5. // Created by Worthy on 2017/11/2.
  6. // Copyright © 2017年 Leigang. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "VODUploadSVideoModel.h"
  10. @protocol VODUploadSVideoClientDelegate <NSObject>
  11. - (void)uploadSuccessWithResult:(VodSVideoUploadResult *)result;
  12. - (void)uploadFailedWithCode:(NSString *)code message:(NSString *)message;
  13. - (void)uploadProgressWithUploadedSize:(long long)uploadedSize totalSize:(long long)totalSize;
  14. - (void)uploadTokenExpired;
  15. - (void)uploadRetry;
  16. - (void)uploadRetryResume;
  17. @optional
  18. - (void)uploadSuccessWithVid:(NSString *)vid imageUrl:(NSString *)imageUrl __deprecated_msg("using uploadSuccessWithResult: instead");
  19. @end
  20. /**
  21. 图片/视频同时上传
  22. 不支持点播凭证方式,已废弃
  23. 推荐使用VODUploadClient点播凭证方式分别上传图片和视频
  24. */
  25. __deprecated_msg("已废弃") @interface VODUploadSVideoClient : NSObject
  26. @property (nonatomic, weak) id<VODUploadSVideoClientDelegate> delegate;
  27. /**
  28. transcode default value is YES
  29. */
  30. @property (nonatomic, assign) BOOL transcode;
  31. /**
  32. Max retry count, default value is INT_MAX
  33. Client will retry automatically in every 2 seconds when network is unavailable
  34. */
  35. @property (nonatomic, assign) uint32_t maxRetryCount;
  36. /**
  37. Sets single object download's max time
  38. */
  39. @property (nonatomic, assign) NSTimeInterval timeoutIntervalForRequest;
  40. /**
  41. directory path about create record uploadId file
  42. */
  43. @property (nonatomic, copy) NSString * recordDirectoryPath;
  44. /**
  45. record upload progress, default value is YES
  46. */
  47. @property (nonatomic, assign) BOOL recordUploadProgress;
  48. /**
  49. size of upload part, default value is 1024 * 1024
  50. */
  51. @property (nonatomic, assign) NSInteger uploadPartSize;
  52. /**
  53. vod region, defalut value is "cn-shanghai"
  54. */
  55. @property (nonatomic, copy) NSString *region;
  56. /**
  57. App id
  58. */
  59. @property (nonatomic, copy) NSString* appId;
  60. /**
  61. workflow id
  62. */
  63. @property (nonatomic, copy) NSString* workflowId;
  64. /**
  65. report enabled
  66. */
  67. @property (nonatomic, assign) BOOL reportEnabled;
  68. /**
  69. 开始上传
  70. @param videoPath 视频文件路径
  71. @param imagePath 图片文件路径
  72. @param svideoInfo 短视频上传信息
  73. @param accessKeyId STS accessKeyId
  74. @param accessKeySecret STS accessKeySecret
  75. @param accessToken STS accessToken
  76. @return 调用接口是否成功
  77. */
  78. - (BOOL)uploadWithVideoPath:(NSString *)videoPath
  79. imagePath:(NSString *)imagePath
  80. svideoInfo:(VodSVideoInfo *)svideoInfo
  81. accessKeyId:(NSString *)accessKeyId
  82. accessKeySecret:(NSString *)accessKeySecret
  83. accessToken:(NSString *)accessToken;
  84. /**
  85. 暂停上传
  86. */
  87. - (void)pause;
  88. /**
  89. 恢复上传
  90. */
  91. - (void)resume;
  92. /**
  93. 刷新STS凭证,并继续上传
  94. @param accessKeyId STS accessKeyId
  95. @param accessKeySecret STS accessKeySecret
  96. @param accessToken STS accessToken
  97. @param expireTime STS expireTime
  98. */
  99. - (void)refreshWithAccessKeyId:(NSString *)accessKeyId
  100. accessKeySecret:(NSString *)accessKeySecret
  101. accessToken:(NSString *)accessToken
  102. expireTime:(NSString *)expireTime;
  103. /**
  104. 取消上传
  105. */
  106. - (void)cancel;
  107. @end