Search in sources :

Example 1 with MediaTemplateRequest

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);
}
Also used : MediaTemplateResponse(com.qcloud.cos.model.ciModel.template.MediaTemplateResponse) MediaTemplateRequest(com.qcloud.cos.model.ciModel.template.MediaTemplateRequest)

Example 2 with MediaTemplateRequest

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);
    }
}
Also used : MediaTemplateRequest(com.qcloud.cos.model.ciModel.template.MediaTemplateRequest) MediaTemplateObject(com.qcloud.cos.model.ciModel.template.MediaTemplateObject) MediaListTemplateResponse(com.qcloud.cos.model.ciModel.template.MediaListTemplateResponse)

Example 3 with MediaTemplateRequest

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);
}
Also used : MediaTemplateResponse(com.qcloud.cos.model.ciModel.template.MediaTemplateResponse) MediaTemplateRequest(com.qcloud.cos.model.ciModel.template.MediaTemplateRequest)

Example 4 with MediaTemplateRequest

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);
}
Also used : MediaTemplateRequest(com.qcloud.cos.model.ciModel.template.MediaTemplateRequest)

Example 5 with MediaTemplateRequest

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);
}
Also used : MediaTemplateRequest(com.qcloud.cos.model.ciModel.template.MediaTemplateRequest) MediaTemplateObject(com.qcloud.cos.model.ciModel.template.MediaTemplateObject) MediaListTemplateResponse(com.qcloud.cos.model.ciModel.template.MediaListTemplateResponse)

Aggregations

MediaTemplateRequest (com.qcloud.cos.model.ciModel.template.MediaTemplateRequest)13 MediaListTemplateResponse (com.qcloud.cos.model.ciModel.template.MediaListTemplateResponse)4 MediaTemplateObject (com.qcloud.cos.model.ciModel.template.MediaTemplateObject)4 MediaTemplateResponse (com.qcloud.cos.model.ciModel.template.MediaTemplateResponse)4 MediaAudioObject (com.qcloud.cos.model.ciModel.job.MediaAudioObject)2 MediaTimeIntervalObject (com.qcloud.cos.model.ciModel.job.MediaTimeIntervalObject)2 MediaTransConfigObject (com.qcloud.cos.model.ciModel.job.MediaTransConfigObject)2 MediaVideoObject (com.qcloud.cos.model.ciModel.job.MediaVideoObject)2 Test (org.junit.Test)1