无标题文章

@interface VideoUploadObject ()@property (nonatomic,strong) TXPublishParam * param;

@end

@implementation VideoUploadObject

single_implementation(VideoUploadObject)

-(void)setInit{

if (!_param) {

_param = [[TXPublishParam alloc] init];

}

}

-(void)setSignature:(NSString *)signature

{

[self setInit];

_param.signature = signature;

[self initTheUploadVideoPath:self.dbPath coverImage:nil];

}

-(void)getTheSigNatureBlock:(theSigNature)block

{

[HXHttpTool getWithPath:[NSString stringWithFormat:@"%@%@",IP,getUploadSign_url] params:nil success:^(id JSON) {

if ([[JSON objectForKey:@"msg"] isEqualToString:@"OK"]) {

block([JSON objectForKey:@"data"]);

}

else

{

block(@"error");

}

} failure:^(NSError *error) {

block(@"error");

}];

}

-(void)initTheUploadVideoPath:(NSString *)videoPath coverImage:(UIImage *)coverImage

{

NSLog(@"videoPath==--==%@",videoPath);

_param.videoPath = videoPath;

_param.coverImage = coverImage;

TXUGCPublish *publish = [[TXUGCPublish alloc] init];

publish.delegate = self;                                // 设置 TXVideoPublishListener 回调

[publish publishVideo:_param];

}

-(void) onPublishProgress:(NSInteger)uploadBytes totalBytes: (NSInteger)totalBytes

{

if (_theUpLoadProgress)

{

_theUpLoadProgress(uploadBytes,totalBytes);

}

}

-(void) onPublishComplete:(TXPublishResult*)result

{

if (_result)

{

_result(result);

}

}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 转至元数据结尾创建: 董潇伟,最新修改于: 十二月 23, 2016 转至元数据起始第一章:isa和Class一....
    40c0490e5268阅读 5,873评论 0 9
  • 1、设置UILabel行间距 NSMutableAttributedString*attrString=[[NSM...
    iOS祎阅读 6,669评论 0 0
  • //// NSObject+YYModel.h// YYModel https://github.com/ib...
    晓丶维阅读 1,756评论 0 0
  • 近期的借贷宝8G的视频引爆了全网,在一些网站上都可以看到分集的。就这个问题我不说没还钱就怎么样,但是真的是你还钱视...
    离殇一曲有人合阅读 3,110评论 1 3
  • 半夜睡不着,突然想起了你们。工作以后越发感到精力不济,想想十年前自己每天睡5个小时天文地理文史哲样样通达,大概梦里...
    aris_lee阅读 1,472评论 0 0

友情链接更多精彩内容