use of com.tencentcloudapi.vod.v20180717.models.DescribeMediaInfosRequest in project cloud-sdk by mizhousoft.
the class QCloudVODServiceImpl method getVideoMeta.
/**
* {@inheritDoc}
*/
@Override
public MediaMeta getVideoMeta(String fileId) throws CloudSDKException {
try {
String[] fileIds = { fileId };
DescribeMediaInfosRequest req = new DescribeMediaInfosRequest();
req.setFileIds(fileIds);
DescribeMediaInfosResponse resp = vodClient.DescribeMediaInfos(req);
MediaInfo[] mediaInfos = resp.getMediaInfoSet();
if (null != mediaInfos && 1 == mediaInfos.length) {
MediaInfo mediaInfo = mediaInfos[0];
MediaMeta meta = buildMediaMeta(fileId, mediaInfo.getBasicInfo(), mediaInfo.getMetaData(), mediaInfo.getTranscodeInfo());
return meta;
} else {
return null;
}
} catch (TencentCloudSDKException e) {
throw new CloudSDKException(e.getErrorCode(), e.getMessage(), e);
}
}
Aggregations