Skip to content

fix(vod): [116206298] vod update #2582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changelog/2582.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:enhancement
resource/tencentcloud_vod_adaptive_dynamic_streaming_template: add param `segment_type`
```

```release-note:enhancement
resource/tencentcloud_vod_procedure_template: update param `adaptive_dynamic_streaming_task_list` and `review_audio_video_task`
```
1 change: 0 additions & 1 deletion tencentcloud/provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,6 @@ Video on Demand(VOD)
tencentcloud_vod_procedure_template
tencentcloud_vod_snapshot_by_time_offset_template
tencentcloud_vod_image_sprite_template
tencentcloud_vod_super_player_config
tencentcloud_vod_sub_application
tencentcloud_vod_sample_snapshot_template
tencentcloud_vod_transcode_template
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@ func ResourceTencentCloudVodAdaptiveDynamicStreamingTemplate() *schema.Resource
},
},
},
"segment_type": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Segment type, valid when Format is HLS, optional values:\n" +
"- ts: ts segment;\n" +
"- fmp4: fmp4 segment;\n" +
"Default value: ts.",
},
// computed
"create_time": {
Type: schema.TypeString,
Expand All @@ -257,6 +266,9 @@ func resourceTencentCloudVodAdaptiveDynamicStreamingTemplateCreate(d *schema.Res
request = vod.NewCreateAdaptiveDynamicStreamingTemplateRequest()
)

if v, ok := d.GetOk("segment_type"); ok {
request.SegmentType = helper.String(v.(string))
}
request.Format = helper.String(d.Get("format").(string))
request.Name = helper.String(d.Get("name").(string))
if v, ok := d.GetOk("drm_type"); ok {
Expand Down Expand Up @@ -403,6 +415,7 @@ func resourceTencentCloudVodAdaptiveDynamicStreamingTemplateRead(d *schema.Resou
_ = d.Set("comment", template.Comment)
_ = d.Set("create_time", template.CreateTime)
_ = d.Set("update_time", template.UpdateTime)
_ = d.Set("segment_type", template.SegmentType)

var streamInfos = make([]interface{}, 0, len(template.StreamInfos))
for _, v := range template.StreamInfos {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func TestAccTencentCloudVodAdaptiveDynamicStreamingTemplateResource(t *testing.T
resource.TestCheckResourceAttrSet("tencentcloud_vod_adaptive_dynamic_streaming_template.foo", "create_time"),
resource.TestCheckResourceAttrSet("tencentcloud_vod_adaptive_dynamic_streaming_template.foo", "update_time"),
resource.TestCheckResourceAttrSet("tencentcloud_vod_adaptive_dynamic_streaming_template.foo", "sub_app_id"),
resource.TestCheckResourceAttr("tencentcloud_vod_adaptive_dynamic_streaming_template.foo", "segment_type", "ts"),
),
},
{
Expand Down
36 changes: 36 additions & 0 deletions tencentcloud/services/vod/resource_tc_vod_procedure_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,15 @@ func ResourceTencentCloudVodProcedureTemplate() *schema.Resource {
Description: "List of up to `10` image or text watermarks. Note: this field may return null, indicating that no valid values can be obtained.",
Elem: VodWatermarkResource(),
},
"subtitle_list": {
Type: schema.TypeList,
Optional: true,
Computed: true,
Description: "Subtitle list, element is subtitle ID, support multiple subtitles, up to 16.",
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
},
},
},
Expand Down Expand Up @@ -393,6 +402,12 @@ func ResourceTencentCloudVodProcedureTemplate() *schema.Resource {
"- `Media`: The original audio/video;\n" +
"- `Cover`: Thumbnails.",
},
"definition": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Review template.",
},
},
},
},
Expand Down Expand Up @@ -724,6 +739,17 @@ func generateMediaProcessTask(d *schema.ResourceData) (mediaReq *vod.MediaProces
return &idUint
}(item["definition"].(string)),
WatermarkSet: genWatermarkList(item),
SubtitleSet: func() (list []*string) {
if _, ok := item["subtitle_list"]; !ok {
return nil
}
subtitleList := item["subtitle_list"].([]interface{})
list = make([]*string, 0, len(subtitleList))
for _, subTitle := range subtitleList {
list = append(list, helper.String(subTitle.(string)))
}
return list
}(),
})
}
mediaReq.AdaptiveDynamicStreamingTaskSet = adaptiveReq
Expand Down Expand Up @@ -1084,6 +1110,16 @@ func resourceTencentCloudVodProcedureTemplateRead(d *schema.ResourceData, meta i
}
return waterList
}(),
"subtitle_list": func() interface{} {
if item.SubtitleSet == nil {
return nil
}
subtitleList := make([]interface{}, 0, len(item.SubtitleSet))
for _, subtitleV := range item.SubtitleSet {
subtitleList = append(subtitleList, subtitleV)
}
return subtitleList
}(),
})
}
mediaProcessTaskElem["adaptive_dynamic_streaming_task_list"] = list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ The following arguments are supported:
* `disable_higher_video_bitrate` - (Optional, Bool) Whether to prohibit transcoding video from low bitrate to high bitrate. Valid values: `false`,`true`. `false`: no, `true`: yes. Default value: `false`.
* `disable_higher_video_resolution` - (Optional, Bool) Whether to prohibit transcoding from low resolution to high resolution. Valid values: `false`,`true`. `false`: no, `true`: yes. Default value: `false`.
* `drm_type` - (Optional, String, ForceNew) DRM scheme type. Valid values: `SimpleAES`. If this field is an empty string, DRM will not be performed on the video.
* `segment_type` - (Optional, String) Segment type, valid when Format is HLS, optional values:
- ts: ts segment;
- fmp4: fmp4 segment;
Default value: ts.
* `sub_app_id` - (Optional, Int) The VOD [application](https://intl.cloud.tencent.com/document/product/266/14574) ID. For customers who activate VOD service from December 25, 2023, if they want to access resources in a VOD application (whether it's the default application or a newly created one), they must fill in this field with the application ID.

The `audio` object of `stream_info` supports the following:
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/vod_procedure_template.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ The following arguments are supported:
The `adaptive_dynamic_streaming_task_list` object of `media_process_task` supports the following:

* `definition` - (Required, String) Adaptive bitrate streaming template ID.
* `subtitle_list` - (Optional, List) Subtitle list, element is subtitle ID, support multiple subtitles, up to 16.
* `watermark_list` - (Optional, List) List of up to `10` image or text watermarks. Note: this field may return null, indicating that no valid values can be obtained.

The `ai_analysis_task` object supports the following:
Expand Down Expand Up @@ -212,6 +213,7 @@ The `mosaic_list` object of `transcode_task_list` supports the following:

The `review_audio_video_task` object supports the following:

* `definition` - (Optional, String) Review template.
* `review_contents` - (Optional, List) The type of moderated content. Valid values:
- `Media`: The original audio/video;
- `Cover`: Thumbnails.
Expand Down
3 changes: 0 additions & 3 deletions website/tencentcloud.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5881,9 +5881,6 @@
<li>
<a href="/docs/providers/tencentcloud/r/vod_sub_application.html">tencentcloud_vod_sub_application</a>
</li>
<li>
<a href="/docs/providers/tencentcloud/r/vod_super_player_config.html">tencentcloud_vod_super_player_config</a>
</li>
<li>
<a href="/docs/providers/tencentcloud/r/vod_transcode_template.html">tencentcloud_vod_transcode_template</a>
</li>
Expand Down