use of com.qcloud.cos.model.ciModel.template.MediaTemplateRequest in project cos-java-sdk-v5 by tencentyun.
the class AnimationTemplateDemo method createMediaTemplate.
/**
* CreateMediaTemplate 用于新增动图模板。
*
* @param client
*/
public static void createMediaTemplate(COSClient client) throws UnsupportedEncodingException {
// 1.创建模板请求对象
MediaTemplateRequest request = new MediaTemplateRequest();
// 2.添加请求参数 参数详情请见api接口文档
request.setBucketName("DemoBucket-123456789");
request.setTag("Animation");
request.setName("TestTemplate40");
request.getContainer().setFormat("gif");
request.getVideo().setCodec("gif");
request.getVideo().setWidth("1280");
request.getVideo().setFps("15");
request.getVideo().setAnimateOnlyKeepKeyFrame("true");
request.getTimeInterval().setStart("0");
request.getTimeInterval().setDuration("60");
// 3.调用接口,获取模板响应对象
MediaTemplateResponse response = client.createMediaTemplate(request);
System.out.println(response);
}
use of com.qcloud.cos.model.ciModel.template.MediaTemplateRequest in project cos-java-sdk-v5 by tencentyun.
the class AnimationTemplateDemo method describeMediaTemplates.
/**
* DescribeMediaTemplates 用于查询动图模板。
*
* @param client
*/
public static void describeMediaTemplates(COSClient client) {
// 1.创建模板请求对象
MediaTemplateRequest request = new MediaTemplateRequest();
// 2.添加请求参数 参数详情请见api接口文档
request.setBucketName("DemoBucket-123456789");
// 3.调用接口,获取模板响应对象
MediaListTemplateResponse response = client.describeMediaTemplates(request);
List<MediaTemplateObject> templateList = response.getTemplateList();
for (MediaTemplateObject mediaTemplateObject : templateList) {
System.out.println(mediaTemplateObject);
}
}
use of com.qcloud.cos.model.ciModel.template.MediaTemplateRequest in project cos-java-sdk-v5 by tencentyun.
the class SnapshotTemplateDemo method createMediaTemplate.
/**
* CreateMediaTemplate 用于新增截图模板。
*
* @param client
*/
public static void createMediaTemplate(COSClient client) throws UnsupportedEncodingException {
// 1.创建模板请求对象
MediaTemplateRequest request = new MediaTemplateRequest();
// 2.添加请求参数 参数详情请见api接口文档
request.setBucketName("DemoBucket-123456789");
request.setTag("Snapshot");
request.setName("mark-test-1");
request.getSnapshot().setMode("Interval");
request.getSnapshot().setWidth("1280");
request.getSnapshot().setStart("0");
request.getSnapshot().setCount("1");
// 3.调用接口,获取模板响应对象
MediaTemplateResponse response = client.createMediaTemplate(request);
System.out.println(response);
}
use of com.qcloud.cos.model.ciModel.template.MediaTemplateRequest in project cos-java-sdk-v5 by tencentyun.
the class SnapshotTemplateDemo method deleteMediaTemplate.
/**
* DeleteMediaTemplate 用于删除截图模板。
*
* @param client
*/
public static void deleteMediaTemplate(COSClient client) {
// 1.创建模板请求对象
MediaTemplateRequest request = new MediaTemplateRequest();
// 2.添加请求参数 参数详情请见api接口文档
request.setBucketName("DemoBucket-123456789");
request.setTemplateId("t19c4a60ae1a694621a01f0c7130c*****");
// 3.调用接口,获取模板响应对象
Boolean response = client.deleteMediaTemplate(request);
System.out.println(response);
}
use of com.qcloud.cos.model.ciModel.template.MediaTemplateRequest in project cos-java-sdk-v5 by tencentyun.
the class SnapshotTemplateDemo method describeMediaTemplates.
/**
* DescribeMediaTemplates 用于查询截图模板。
*
* @param client
*/
public static void describeMediaTemplates(COSClient client) {
// 1.创建模板请求对象
MediaTemplateRequest request = new MediaTemplateRequest();
// 2.添加请求参数 参数详情请见api接口文档
request.setBucketName("DemoBucket-123456789");
request.setTag("Snapshot");
// 3.调用接口,获取模板响应对象
MediaListTemplateResponse response = client.describeMediaTemplates(request);
List<MediaTemplateObject> templateList = response.getTemplateList();
for (MediaTemplateObject mediaTemplateObject : templateList) {
System.out.println(mediaTemplateObject);
}
System.out.println(response);
}
Aggregations