Commit 3f3c0dae84a93b7d616c88fa54585e0d8d5a2e36
1 parent
8b227b79
更新方法
Showing
2 changed files
with
63 additions
and
50 deletions
CNLiveUploadYunSDKDemo/CNLiveUploadYunSDKDemo/AppDelegate.h
| @@ -8,8 +8,8 @@ | @@ -8,8 +8,8 @@ | ||
| 8 | 8 | ||
| 9 | #import <UIKit/UIKit.h> | 9 | #import <UIKit/UIKit.h> |
| 10 | 10 | ||
| 11 | -#define AppId @"60_j5xilfyl12" | ||
| 12 | -#define AppKey @"8b58d3dcdd828359e6113d5531029801e5d2b53e9a980c" | 11 | +#define AppId @"60_jaxisljz90" |
| 12 | +#define AppKey @"1ee33b54e18a66b94eca7f8149408565b02f749d314926" | ||
| 13 | 13 | ||
| 14 | @interface AppDelegate : UIResponder <UIApplicationDelegate> | 14 | @interface AppDelegate : UIResponder <UIApplicationDelegate> |
| 15 | 15 |
CNLiveUploadYunSDKDemo/CNLiveUploadYunSDKDemo/CNLiveUploadController.m
| @@ -16,13 +16,14 @@ | @@ -16,13 +16,14 @@ | ||
| 16 | #define FileBlockSize 5*1024*1024 //一块大小,分块最小5M | 16 | #define FileBlockSize 5*1024*1024 //一块大小,分块最小5M |
| 17 | 17 | ||
| 18 | //上传 | 18 | //上传 |
| 19 | -#define kUploadBucketKey @"7.6M.mov" //上传时用到的bucket里文件的路径,此为在wz目录下7.6M.mov | ||
| 20 | -#define kUploadBucketName @"compose" //上传所用的bucketName | ||
| 21 | #define keyUploadPartNum @"partNum" //需要app本地存储已经传成功的块号,demo为了演示,用NSUserDefaults存储,app可用数据库等 | 19 | #define keyUploadPartNum @"partNum" //需要app本地存储已经传成功的块号,demo为了演示,用NSUserDefaults存储,app可用数据库等 |
| 22 | #define keyUploadId @"uploadId" //需要app本地存储已经初始化成功的uploadId,用于断点续传,demo为了演示,用NSUserDefaults存储,app可用数据库等 | 20 | #define keyUploadId @"uploadId" //需要app本地存储已经初始化成功的uploadId,用于断点续传,demo为了演示,用NSUserDefaults存储,app可用数据库等 |
| 23 | 21 | ||
| 24 | @interface CNLiveUploadController ()<UITableViewDelegate,UITableViewDataSource,KingSoftServiceRequestDelegate> | 22 | @interface CNLiveUploadController ()<UITableViewDelegate,UITableViewDataSource,KingSoftServiceRequestDelegate> |
| 25 | - | 23 | +{ |
| 24 | + NSString *_bucketName;//SP对应的bucketName | ||
| 25 | + NSString *_bucketKey;//SP上传时用到的bucket里文件的路径(包含扩展名) | ||
| 26 | +} | ||
| 26 | @property (nonatomic ,strong) UITableView * tableView; | 27 | @property (nonatomic ,strong) UITableView * tableView; |
| 27 | 28 | ||
| 28 | @property (assign, nonatomic) long long fileSize; | 29 | @property (assign, nonatomic) long long fileSize; |
| @@ -33,7 +34,6 @@ | @@ -33,7 +34,6 @@ | ||
| 33 | @property (strong, nonatomic) NSFileHandle *fileHandle; | 34 | @property (strong, nonatomic) NSFileHandle *fileHandle; |
| 34 | @property (nonatomic, strong) NSArray *arrItems; | 35 | @property (nonatomic, strong) NSArray *arrItems; |
| 35 | @property (strong, nonatomic) CNLiveMultipartUpload *muilt; | 36 | @property (strong, nonatomic) CNLiveMultipartUpload *muilt; |
| 36 | - | ||
| 37 | @end | 37 | @end |
| 38 | 38 | ||
| 39 | @implementation CNLiveUploadController | 39 | @implementation CNLiveUploadController |
| @@ -50,6 +50,17 @@ | @@ -50,6 +50,17 @@ | ||
| 50 | [self.view addSubview:self.tableView]; | 50 | [self.view addSubview:self.tableView]; |
| 51 | self.tableView.delegate = self; | 51 | self.tableView.delegate = self; |
| 52 | self.tableView.dataSource = self; | 52 | self.tableView.dataSource = self; |
| 53 | + | ||
| 54 | + _bucketName = [CNLiveUpload getSPBucketName]; | ||
| 55 | + NSLog(@"bucketName:%@",_bucketName); | ||
| 56 | + [self getBucketKeyFromServer]; | ||
| 57 | +} | ||
| 58 | + | ||
| 59 | +- (void)getBucketKeyFromServer | ||
| 60 | +{ | ||
| 61 | +#warning 此处建议从server获取 上传文件对应的bucketKey(文件路径包含扩展名) | ||
| 62 | +#warning Demo为了演示 bucketKey用固定值 | ||
| 63 | + _bucketKey = @"cnlive12/test123-7.6M.mov"; | ||
| 53 | } | 64 | } |
| 54 | 65 | ||
| 55 | #pragma mark 相册方法 | 66 | #pragma mark 相册方法 |
| @@ -124,21 +135,21 @@ | @@ -124,21 +135,21 @@ | ||
| 124 | */ | 135 | */ |
| 125 | - (void)beginMultipartUpload | 136 | - (void)beginMultipartUpload |
| 126 | { | 137 | { |
| 127 | - NSString *strKey = kUploadBucketKey; //key 为在bucket下的路径,demo中为根目录下7.6M.mov路径 | 138 | + NSString *strKey = _bucketKey; |
| 128 | _partSize = 5; // 文件大于5M为最小5M一块 | 139 | _partSize = 5; // 文件大于5M为最小5M一块 |
| 129 | - | 140 | + |
| 130 | CNLiveAccessControlList *acl = [[CNLiveAccessControlList alloc] init]; | 141 | CNLiveAccessControlList *acl = [[CNLiveAccessControlList alloc] init]; |
| 131 | [acl setContronAccess:CNLiveYun_Permission_Public_Read]; | 142 | [acl setContronAccess:CNLiveYun_Permission_Public_Read]; |
| 132 | - | ||
| 133 | - CNLiveInitiateMultipartUploadRequest *initMultipartUploadReq = [[CNLiveInitiateMultipartUploadRequest alloc] initWithKey:strKey inBucket:kUploadBucketName acl:acl grantAcl:nil]; | 143 | + |
| 144 | + CNLiveInitiateMultipartUploadRequest *initMultipartUploadReq = [[CNLiveInitiateMultipartUploadRequest alloc] initWithKey:strKey inBucket:_bucketName acl:acl grantAcl:nil]; | ||
| 134 | [initMultipartUploadReq setCompleteRequest]; | 145 | [initMultipartUploadReq setCompleteRequest]; |
| 135 | - | 146 | + |
| 136 | NSArray *array = [initMultipartUploadReq.CNYHeader componentsSeparatedByString:@"\n"]; | 147 | NSArray *array = [initMultipartUploadReq.CNYHeader componentsSeparatedByString:@"\n"]; |
| 137 | NSString *headers = [array firstObject]; | 148 | NSString *headers = [array firstObject]; |
| 138 | - | ||
| 139 | - [CNLiveUpload getTokenWithMd5:initMultipartUploadReq.contentMd5 verb:initMultipartUploadReq.httpMethod type:initMultipartUploadReq.contentType res:initMultipartUploadReq.CNYResource headers:headers date:initMultipartUploadReq.strDate success:^(NSString *token) { | 149 | + |
| 150 | + [CNLiveUpload getTokenWithMd5:initMultipartUploadReq.contentMd5 verb:initMultipartUploadReq.httpMethod type:initMultipartUploadReq.contentType res:initMultipartUploadReq.CNYResource headers:headers date:initMultipartUploadReq.strDate success:^(NSString *token ,NSString *cnliveDate) { | ||
| 140 | [initMultipartUploadReq setStrCNLiveToken:token]; | 151 | [initMultipartUploadReq setStrCNLiveToken:token]; |
| 141 | - | 152 | + [initMultipartUploadReq setStrDate:cnliveDate]; |
| 142 | _muilt = [[CNLiveClient initialize] initiateMultipartUploadWithRequest:initMultipartUploadReq]; | 153 | _muilt = [[CNLiveClient initialize] initiateMultipartUploadWithRequest:initMultipartUploadReq]; |
| 143 | 154 | ||
| 144 | if (_muilt == nil) { | 155 | if (_muilt == nil) { |
| @@ -196,12 +207,9 @@ | @@ -196,12 +207,9 @@ | ||
| 196 | //list一下所有上传过的块 | 207 | //list一下所有上传过的块 |
| 197 | CNLiveListPartsRequest *req2 = [[CNLiveListPartsRequest alloc] initWithMultipartUpload:_muilt]; | 208 | CNLiveListPartsRequest *req2 = [[CNLiveListPartsRequest alloc] initWithMultipartUpload:_muilt]; |
| 198 | [req2 setCompleteRequest]; | 209 | [req2 setCompleteRequest]; |
| 199 | - | ||
| 200 | - //使用token签名时从Appserver获取token后设置token,使用Ak sk则忽略,不需要调用 | ||
| 201 | - | ||
| 202 | - [CNLiveUpload getTokenWithMd5:req2.contentMd5 verb:req2.httpMethod type:req2.contentType res:req2.CNYResource headers:headers date:req2.strDate success:^(NSString *token) { | 210 | + [CNLiveUpload getTokenWithMd5:req2.contentMd5 verb:req2.httpMethod type:req2.contentType res:req2.CNYResource headers:headers date:req2.strDate success:^(NSString *token ,NSString *cnliveDate) { |
| 203 | [req2 setStrCNLiveToken:token]; | 211 | [req2 setStrCNLiveToken:token]; |
| 204 | - | 212 | + [req2 setStrDate:cnliveDate]; |
| 205 | CNLiveListPartsResponse *response2 = [[CNLiveClient initialize] listParts:req2]; | 213 | CNLiveListPartsResponse *response2 = [[CNLiveClient initialize] listParts:req2]; |
| 206 | 214 | ||
| 207 | NSLog(@"response.listResult.parts.count =%lu",(unsigned long)[response2.listResult.parts count]); | 215 | NSLog(@"response.listResult.parts.count =%lu",(unsigned long)[response2.listResult.parts count]); |
| @@ -219,8 +227,6 @@ | @@ -219,8 +227,6 @@ | ||
| 219 | 227 | ||
| 220 | }]; | 228 | }]; |
| 221 | } | 229 | } |
| 222 | - //initMultipartUploadReq.strDate = @"Fri, 15 Jul 2016 09:21:30 GMT"; | ||
| 223 | - //initMultipartUploadReq.strKS3Token = @"KSS JYWSSnN5qY/hFiWg/Y1V:s1ICTedN7C+QqGFMD1FQYj6/bYA="; | ||
| 224 | } failure:^(NSDictionary *error) { | 230 | } failure:^(NSDictionary *error) { |
| 225 | 231 | ||
| 226 | }]; | 232 | }]; |
| @@ -249,20 +255,19 @@ | @@ -249,20 +255,19 @@ | ||
| 249 | [_fileHandle seekToFileOffset:_partLength*(_uploadNum)]; | 255 | [_fileHandle seekToFileOffset:_partLength*(_uploadNum)]; |
| 250 | } | 256 | } |
| 251 | } | 257 | } |
| 252 | - | 258 | + |
| 253 | CNLiveUploadPartRequest *req = [[CNLiveUploadPartRequest alloc] initWithMultipartUpload:_muilt partNumber:(int32_t)partNumber data:data generateMD5:NO]; | 259 | CNLiveUploadPartRequest *req = [[CNLiveUploadPartRequest alloc] initWithMultipartUpload:_muilt partNumber:(int32_t)partNumber data:data generateMD5:NO]; |
| 254 | req.delegate = self; | 260 | req.delegate = self; |
| 255 | req.contentLength = data.length; | 261 | req.contentLength = data.length; |
| 256 | req.contentMd5 = [CNLiveSDKUtil base64md5FromData:data]; | 262 | req.contentMd5 = [CNLiveSDKUtil base64md5FromData:data]; |
| 257 | [req setCompleteRequest]; | 263 | [req setCompleteRequest]; |
| 258 | - | 264 | + |
| 259 | NSArray *array = [req.CNYHeader componentsSeparatedByString:@"\n"]; | 265 | NSArray *array = [req.CNYHeader componentsSeparatedByString:@"\n"]; |
| 260 | NSString *headers = [array firstObject]; | 266 | NSString *headers = [array firstObject]; |
| 261 | 267 | ||
| 262 | - [CNLiveUpload getTokenWithMd5:req.contentMd5 verb:req.httpMethod type:req.contentType res:req.CNYResource headers:headers date:req.strDate success:^(NSString *token) { | ||
| 263 | - //使用token签名时从Appserver获取token后设置token,使用Ak sk则忽略,不需要调用 | 268 | + [CNLiveUpload getTokenWithMd5:req.contentMd5 verb:req.httpMethod type:req.contentType res:req.CNYResource headers:headers date:req.strDate success:^(NSString *token ,NSString *cnliveDate) { |
| 264 | [req setStrCNLiveToken:token]; | 269 | [req setStrCNLiveToken:token]; |
| 265 | - | 270 | + [req setStrDate:cnliveDate]; |
| 266 | [[CNLiveClient initialize] uploadPart:req]; | 271 | [[CNLiveClient initialize] uploadPart:req]; |
| 267 | } failure:^(NSDictionary *error) { | 272 | } failure:^(NSDictionary *error) { |
| 268 | 273 | ||
| @@ -276,16 +281,16 @@ | @@ -276,16 +281,16 @@ | ||
| 276 | NSLog(@"请先创建上传,再调用Abort"); | 281 | NSLog(@"请先创建上传,再调用Abort"); |
| 277 | return; | 282 | return; |
| 278 | } | 283 | } |
| 279 | - | 284 | + |
| 280 | CNLiveAbortMultipartUploadRequest *request = [[CNLiveAbortMultipartUploadRequest alloc] initWithMultipartUpload:_muilt]; | 285 | CNLiveAbortMultipartUploadRequest *request = [[CNLiveAbortMultipartUploadRequest alloc] initWithMultipartUpload:_muilt]; |
| 281 | [request setCompleteRequest]; | 286 | [request setCompleteRequest]; |
| 282 | - | 287 | + |
| 283 | NSArray *array = [request.CNYHeader componentsSeparatedByString:@"\n"]; | 288 | NSArray *array = [request.CNYHeader componentsSeparatedByString:@"\n"]; |
| 284 | NSString *headers = [array firstObject]; | 289 | NSString *headers = [array firstObject]; |
| 285 | 290 | ||
| 286 | - [CNLiveUpload getTokenWithMd5:request.contentMd5 verb:request.httpMethod type:request.contentType res:request.CNYResource headers:headers date:request.strDate success:^(NSString *token) { | 291 | + [CNLiveUpload getTokenWithMd5:request.contentMd5 verb:request.httpMethod type:request.contentType res:request.CNYResource headers:headers date:request.strDate success:^(NSString *token ,NSString *cnliveDate) { |
| 287 | [request setStrCNLiveToken:token]; | 292 | [request setStrCNLiveToken:token]; |
| 288 | - | 293 | + [request setStrDate:cnliveDate]; |
| 289 | CNLiveAbortMultipartUploadResponse *response = [[CNLiveClient initialize] abortMultipartUpload:request]; | 294 | CNLiveAbortMultipartUploadResponse *response = [[CNLiveClient initialize] abortMultipartUpload:request]; |
| 290 | if (response.httpStatusCode == 204) { | 295 | if (response.httpStatusCode == 204) { |
| 291 | NSLog(@"Abort multipart upload success!"); | 296 | NSLog(@"Abort multipart upload success!"); |
| @@ -310,24 +315,22 @@ | @@ -310,24 +315,22 @@ | ||
| 310 | { | 315 | { |
| 311 | CNLiveAccessControlList *ControlList = [[CNLiveAccessControlList alloc] init]; | 316 | CNLiveAccessControlList *ControlList = [[CNLiveAccessControlList alloc] init]; |
| 312 | [ControlList setContronAccess:CNLiveYun_Permission_Public_Read_Write]; | 317 | [ControlList setContronAccess:CNLiveYun_Permission_Public_Read_Write]; |
| 313 | - CNLivePutObjectRequest *putObjRequest = [[CNLivePutObjectRequest alloc] initWithName:kUploadBucketName withAcl:ControlList grantAcl:nil]; | ||
| 314 | - | 318 | + CNLivePutObjectRequest *putObjRequest = [[CNLivePutObjectRequest alloc] initWithName:_bucketName withAcl:ControlList grantAcl:nil]; |
| 315 | NSString *fileName = [[NSBundle mainBundle] pathForResource:@"7.6M" ofType:@"mov"]; | 319 | NSString *fileName = [[NSBundle mainBundle] pathForResource:@"7.6M" ofType:@"mov"]; |
| 316 | putObjRequest.data = [NSData dataWithContentsOfFile:fileName options:NSDataReadingMappedIfSafe error:nil]; | 320 | putObjRequest.data = [NSData dataWithContentsOfFile:fileName options:NSDataReadingMappedIfSafe error:nil]; |
| 317 | - | ||
| 318 | _fileSize = putObjRequest.data.length; | 321 | _fileSize = putObjRequest.data.length; |
| 319 | - | 322 | + |
| 320 | putObjRequest.delegate = self; | 323 | putObjRequest.delegate = self; |
| 321 | - putObjRequest.filename = kUploadBucketKey; | 324 | + putObjRequest.filename = _bucketKey; |
| 322 | putObjRequest.contentMd5 = [CNLiveSDKUtil base64md5FromData:putObjRequest.data]; | 325 | putObjRequest.contentMd5 = [CNLiveSDKUtil base64md5FromData:putObjRequest.data]; |
| 323 | [putObjRequest setCompleteRequest]; | 326 | [putObjRequest setCompleteRequest]; |
| 324 | - | 327 | + |
| 325 | NSArray *array = [putObjRequest.CNYHeader componentsSeparatedByString:@"\n"]; | 328 | NSArray *array = [putObjRequest.CNYHeader componentsSeparatedByString:@"\n"]; |
| 326 | NSString *headers = [array firstObject]; | 329 | NSString *headers = [array firstObject]; |
| 327 | 330 | ||
| 328 | - [CNLiveUpload getTokenWithMd5:putObjRequest.contentMd5 verb:putObjRequest.httpMethod type:putObjRequest.contentType res:putObjRequest.CNYResource headers:headers date:putObjRequest.strDate success:^(NSString *token) { | 331 | + [CNLiveUpload getTokenWithMd5:putObjRequest.contentMd5 verb:putObjRequest.httpMethod type:putObjRequest.contentType res:putObjRequest.CNYResource headers:headers date:putObjRequest.strDate success:^(NSString *token ,NSString *cnliveDate) { |
| 329 | [putObjRequest setStrCNLiveToken:token]; | 332 | [putObjRequest setStrCNLiveToken:token]; |
| 330 | - | 333 | + [putObjRequest setStrDate:cnliveDate]; |
| 331 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | 334 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ |
| 332 | CNLivePutObjectResponse *response = [[CNLiveClient initialize] putObject:putObjRequest]; | 335 | CNLivePutObjectResponse *response = [[CNLiveClient initialize] putObject:putObjRequest]; |
| 333 | 336 | ||
| @@ -434,6 +437,11 @@ | @@ -434,6 +437,11 @@ | ||
| 434 | if ([request isKindOfClass:[KS3PutObjectRequest class]]) { | 437 | if ([request isKindOfClass:[KS3PutObjectRequest class]]) { |
| 435 | if (response.httpStatusCode == 200) { | 438 | if (response.httpStatusCode == 200) { |
| 436 | NSLog(@"单块上传成功"); | 439 | NSLog(@"单块上传成功"); |
| 440 | + [CNLiveUpload getUploadResourceUrlWithBucketKey:_bucketKey uploadType:CNLiveYun_UploadType_VideoFile success:^(NSString *resUrl) { | ||
| 441 | + NSLog(@"succ:%@",resUrl); | ||
| 442 | + } failure:^(NSDictionary *error) { | ||
| 443 | + NSLog(@"error%@",error); | ||
| 444 | + }]; | ||
| 437 | }else | 445 | }else |
| 438 | { | 446 | { |
| 439 | NSLog(@"单块上传失败"); | 447 | NSLog(@"单块上传失败"); |
| @@ -453,9 +461,9 @@ | @@ -453,9 +461,9 @@ | ||
| 453 | NSArray *array = [req2.CNYHeader componentsSeparatedByString:@"\n"]; | 461 | NSArray *array = [req2.CNYHeader componentsSeparatedByString:@"\n"]; |
| 454 | NSString *headers = [array firstObject]; | 462 | NSString *headers = [array firstObject]; |
| 455 | 463 | ||
| 456 | - [CNLiveUpload getTokenWithMd5:req2.contentMd5 verb:req2.httpMethod type:req2.contentType res:req2.CNYResource headers:headers date:req2.strDate success:^(NSString *token) { | 464 | + [CNLiveUpload getTokenWithMd5:req2.contentMd5 verb:req2.httpMethod type:req2.contentType res:req2.CNYResource headers:headers date:req2.strDate success:^(NSString *token ,NSString *cnliveDate) { |
| 457 | [req2 setStrCNLiveToken:token]; | 465 | [req2 setStrCNLiveToken:token]; |
| 458 | - | 466 | + [req2 setStrDate:cnliveDate]; |
| 459 | CNLiveListPartsResponse *response2 = [[CNLiveClient initialize] listParts:req2]; | 467 | CNLiveListPartsResponse *response2 = [[CNLiveClient initialize] listParts:req2]; |
| 460 | CNLiveCompleteMultipartUploadRequest *req = [[CNLiveCompleteMultipartUploadRequest alloc] initWithMultipartUpload:_muilt]; | 468 | CNLiveCompleteMultipartUploadRequest *req = [[CNLiveCompleteMultipartUploadRequest alloc] initWithMultipartUpload:_muilt]; |
| 461 | NSLog(@"%@",response2.listResult.parts); | 469 | NSLog(@"%@",response2.listResult.parts); |
| @@ -468,9 +476,9 @@ | @@ -468,9 +476,9 @@ | ||
| 468 | NSArray *array1 = [req.CNYHeader componentsSeparatedByString:@"\n"]; | 476 | NSArray *array1 = [req.CNYHeader componentsSeparatedByString:@"\n"]; |
| 469 | NSString *headers1 = [array1 firstObject]; | 477 | NSString *headers1 = [array1 firstObject]; |
| 470 | 478 | ||
| 471 | - [CNLiveUpload getTokenWithMd5:req.contentMd5 verb:req.httpMethod type:req.contentType res:req.CNYResource headers:headers1 date:req.strDate success:^(NSString *token) { | 479 | + [CNLiveUpload getTokenWithMd5:req.contentMd5 verb:req.httpMethod type:req.contentType res:req.CNYResource headers:headers1 date:req.strDate success:^(NSString *token ,NSString *cnliveDate) { |
| 472 | [req setStrCNLiveToken:token]; | 480 | [req setStrCNLiveToken:token]; |
| 473 | - | 481 | + [req setStrDate:cnliveDate]; |
| 474 | CNLiveCompleteMultipartUploadResponse *resp = [[CNLiveClient initialize] completeMultipartUpload:req]; | 482 | CNLiveCompleteMultipartUploadResponse *resp = [[CNLiveClient initialize] completeMultipartUpload:req]; |
| 475 | NSString *bodyStr = [[NSString alloc]initWithData:resp.body encoding:NSUTF8StringEncoding]; | 483 | NSString *bodyStr = [[NSString alloc]initWithData:resp.body encoding:NSUTF8StringEncoding]; |
| 476 | if (resp.httpStatusCode != 200) { | 484 | if (resp.httpStatusCode != 200) { |
| @@ -482,6 +490,11 @@ | @@ -482,6 +490,11 @@ | ||
| 482 | [mUserDefaults setInteger:0 forKey:keyUploadPartNum]; | 490 | [mUserDefaults setInteger:0 forKey:keyUploadPartNum]; |
| 483 | _uploadNum = 0 ; | 491 | _uploadNum = 0 ; |
| 484 | [mUserDefaults synchronize]; | 492 | [mUserDefaults synchronize]; |
| 493 | + [CNLiveUpload getUploadResourceUrlWithBucketKey:_bucketKey uploadType:CNLiveYun_UploadType_VideoFile success:^(NSString *resUrl) { | ||
| 494 | + NSLog(@"succ: %@",resUrl); | ||
| 495 | + } failure:^(NSDictionary *error) { | ||
| 496 | + NSLog(@"error: %@",error); | ||
| 497 | + }]; | ||
| 485 | } | 498 | } |
| 486 | } failure:^(NSDictionary *error) { | 499 | } failure:^(NSDictionary *error) { |
| 487 | 500 | ||
| @@ -560,14 +573,14 @@ | @@ -560,14 +573,14 @@ | ||
| 560 | } | 573 | } |
| 561 | 574 | ||
| 562 | /* | 575 | /* |
| 563 | -#pragma mark - Navigation | ||
| 564 | - | ||
| 565 | -// In a storyboard-based application, you will often want to do a little preparation before navigation | ||
| 566 | -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | ||
| 567 | - // Get the new view controller using [segue destinationViewController]. | ||
| 568 | - // Pass the selected object to the new view controller. | ||
| 569 | -} | ||
| 570 | -*/ | 576 | + #pragma mark - Navigation |
| 577 | + | ||
| 578 | + // In a storyboard-based application, you will often want to do a little preparation before navigation | ||
| 579 | + - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | ||
| 580 | + // Get the new view controller using [segue destinationViewController]. | ||
| 581 | + // Pass the selected object to the new view controller. | ||
| 582 | + } | ||
| 583 | + */ | ||
| 571 | 584 | ||
| 572 | @end | 585 | @end |
| 573 | 586 |