You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Video Processing
Retrieving Video Information (iOS SDK)
Copy page
Download PDF
Retrieving Video Information (iOS SDK)
The video information retrieval function enables the acquisition of metadata for a specified video resource.​
Sample Code​
The following code demonstrates how to retrieve video information.​
​
​
TOSCredential *credential = [[TOSCredential alloc] initWithAccessKey:@"accesskey" secretKey:@"secretkey" securityToken:@"securityToken"];​
TOSEndpoint *tosEndpoint = [[TOSEndpoint alloc] initWithURLString:@"endpoint" withRegion:@"region"];​
TOSClientConfiguration *config = [[TOSClientConfiguration alloc] initWithEndpoint:tosEndpoint credential:credential];​
TOSClient *client = [[TOSClient alloc] initWithConfiguration:config];​
​
TOSGetObjectInput *get = [TOSGetObjectInput new];​
get.tosBucket = @"bucket-name";​
get.tosKey = @"video-name";​
get.tosProcess = @"video/info";​
TOSTask *task = [client getObject:get];​
[task continueWithBlock:^id _Nullable(TOSTask * _Nonnull t) {​
if (!task.error) {​
NSLog(@"Get object success.");​
​
TOSGetObjectOutput *out = t.result;​
NSLog(@"%@", [[NSString alloc] initWithData:out.tosContent encoding:NSUTF8StringEncoding]);​
} else {​
NSLog(@"Get object failed, error: %@" ,task.error);​
}​
return nil;​
}];​
​
Relevant Documentation​
For a detailed introduction to obtaining video information, please see View Video Information.​
Last updated: 2025.09.25 16:40:50