Search in sources :

Example 1 with ModifyMediaInfoRequest

use of com.tencentcloudapi.vod.v20180717.models.ModifyMediaInfoRequest in project cloud-sdk by mizhousoft.

the class QCloudVODServiceImpl method modifyCover.

/**
 * {@inheritDoc}
 */
@Override
public String modifyCover(String fileId, String base64Data) throws CloudSDKException {
    try {
        ModifyMediaInfoRequest req = new ModifyMediaInfoRequest();
        req.setCoverData(base64Data);
        req.setFileId(fileId);
        ModifyMediaInfoResponse resp = vodClient.ModifyMediaInfo(req);
        if (StringUtils.isBlank(resp.getCoverUrl())) {
            throw new CloudSDKException("Modify cover failed, response: " + ModifyMediaInfoResponse.toJsonString(resp));
        }
        return resp.getCoverUrl();
    } catch (TencentCloudSDKException e) {
        throw new CloudSDKException(e.getErrorCode(), e.getMessage(), e);
    }
}
Also used : CloudSDKException(com.mizhousoft.cloudsdk.CloudSDKException) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) ModifyMediaInfoRequest(com.tencentcloudapi.vod.v20180717.models.ModifyMediaInfoRequest) ModifyMediaInfoResponse(com.tencentcloudapi.vod.v20180717.models.ModifyMediaInfoResponse)

Aggregations

CloudSDKException (com.mizhousoft.cloudsdk.CloudSDKException)1 TencentCloudSDKException (com.tencentcloudapi.common.exception.TencentCloudSDKException)1 ModifyMediaInfoRequest (com.tencentcloudapi.vod.v20180717.models.ModifyMediaInfoRequest)1 ModifyMediaInfoResponse (com.tencentcloudapi.vod.v20180717.models.ModifyMediaInfoResponse)1