Skip to content

Commit 347ce85

Browse files
tongyimingmikatong
authored andcommitted
fix(vod): [116206298] vod update (#2582)
* vod update * add changelog --------- Co-authored-by: mikatong <[email protected]>
1 parent 0fa4917 commit 347ce85

8 files changed

+63
-4
lines changed

.changelog/2582.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_vod_adaptive_dynamic_streaming_template: add param `segment_type`
3+
```
4+
5+
```release-note:enhancement
6+
resource/tencentcloud_vod_procedure_template: update param `adaptive_dynamic_streaming_task_list` and `review_audio_video_task`
7+
```

tencentcloud/provider.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,6 @@ Video on Demand(VOD)
11171117
tencentcloud_vod_procedure_template
11181118
tencentcloud_vod_snapshot_by_time_offset_template
11191119
tencentcloud_vod_image_sprite_template
1120-
tencentcloud_vod_super_player_config
11211120
tencentcloud_vod_sub_application
11221121
tencentcloud_vod_sample_snapshot_template
11231122
tencentcloud_vod_transcode_template

tencentcloud/services/vod/resource_tc_vod_adaptive_dynamic_streaming_template.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,15 @@ func ResourceTencentCloudVodAdaptiveDynamicStreamingTemplate() *schema.Resource
234234
},
235235
},
236236
},
237+
"segment_type": {
238+
Type: schema.TypeString,
239+
Optional: true,
240+
Computed: true,
241+
Description: "Segment type, valid when Format is HLS, optional values:\n" +
242+
"- ts: ts segment;\n" +
243+
"- fmp4: fmp4 segment;\n" +
244+
"Default value: ts.",
245+
},
237246
// computed
238247
"create_time": {
239248
Type: schema.TypeString,
@@ -257,6 +266,9 @@ func resourceTencentCloudVodAdaptiveDynamicStreamingTemplateCreate(d *schema.Res
257266
request = vod.NewCreateAdaptiveDynamicStreamingTemplateRequest()
258267
)
259268

269+
if v, ok := d.GetOk("segment_type"); ok {
270+
request.SegmentType = helper.String(v.(string))
271+
}
260272
request.Format = helper.String(d.Get("format").(string))
261273
request.Name = helper.String(d.Get("name").(string))
262274
if v, ok := d.GetOk("drm_type"); ok {
@@ -403,6 +415,7 @@ func resourceTencentCloudVodAdaptiveDynamicStreamingTemplateRead(d *schema.Resou
403415
_ = d.Set("comment", template.Comment)
404416
_ = d.Set("create_time", template.CreateTime)
405417
_ = d.Set("update_time", template.UpdateTime)
418+
_ = d.Set("segment_type", template.SegmentType)
406419

407420
var streamInfos = make([]interface{}, 0, len(template.StreamInfos))
408421
for _, v := range template.StreamInfos {

tencentcloud/services/vod/resource_tc_vod_adaptive_dynamic_streaming_template_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ func TestAccTencentCloudVodAdaptiveDynamicStreamingTemplateResource(t *testing.T
8383
resource.TestCheckResourceAttrSet("tencentcloud_vod_adaptive_dynamic_streaming_template.foo", "create_time"),
8484
resource.TestCheckResourceAttrSet("tencentcloud_vod_adaptive_dynamic_streaming_template.foo", "update_time"),
8585
resource.TestCheckResourceAttrSet("tencentcloud_vod_adaptive_dynamic_streaming_template.foo", "sub_app_id"),
86+
resource.TestCheckResourceAttr("tencentcloud_vod_adaptive_dynamic_streaming_template.foo", "segment_type", "ts"),
8687
),
8788
},
8889
{

tencentcloud/services/vod/resource_tc_vod_procedure_template.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,15 @@ func ResourceTencentCloudVodProcedureTemplate() *schema.Resource {
334334
Description: "List of up to `10` image or text watermarks. Note: this field may return null, indicating that no valid values can be obtained.",
335335
Elem: VodWatermarkResource(),
336336
},
337+
"subtitle_list": {
338+
Type: schema.TypeList,
339+
Optional: true,
340+
Computed: true,
341+
Description: "Subtitle list, element is subtitle ID, support multiple subtitles, up to 16.",
342+
Elem: &schema.Schema{
343+
Type: schema.TypeString,
344+
},
345+
},
337346
},
338347
},
339348
},
@@ -393,6 +402,12 @@ func ResourceTencentCloudVodProcedureTemplate() *schema.Resource {
393402
"- `Media`: The original audio/video;\n" +
394403
"- `Cover`: Thumbnails.",
395404
},
405+
"definition": {
406+
Type: schema.TypeString,
407+
Optional: true,
408+
Computed: true,
409+
Description: "Review template.",
410+
},
396411
},
397412
},
398413
},
@@ -724,6 +739,17 @@ func generateMediaProcessTask(d *schema.ResourceData) (mediaReq *vod.MediaProces
724739
return &idUint
725740
}(item["definition"].(string)),
726741
WatermarkSet: genWatermarkList(item),
742+
SubtitleSet: func() (list []*string) {
743+
if _, ok := item["subtitle_list"]; !ok {
744+
return nil
745+
}
746+
subtitleList := item["subtitle_list"].([]interface{})
747+
list = make([]*string, 0, len(subtitleList))
748+
for _, subTitle := range subtitleList {
749+
list = append(list, helper.String(subTitle.(string)))
750+
}
751+
return list
752+
}(),
727753
})
728754
}
729755
mediaReq.AdaptiveDynamicStreamingTaskSet = adaptiveReq
@@ -1084,6 +1110,16 @@ func resourceTencentCloudVodProcedureTemplateRead(d *schema.ResourceData, meta i
10841110
}
10851111
return waterList
10861112
}(),
1113+
"subtitle_list": func() interface{} {
1114+
if item.SubtitleSet == nil {
1115+
return nil
1116+
}
1117+
subtitleList := make([]interface{}, 0, len(item.SubtitleSet))
1118+
for _, subtitleV := range item.SubtitleSet {
1119+
subtitleList = append(subtitleList, subtitleV)
1120+
}
1121+
return subtitleList
1122+
}(),
10871123
})
10881124
}
10891125
mediaProcessTaskElem["adaptive_dynamic_streaming_task_list"] = list

website/docs/r/vod_adaptive_dynamic_streaming_template.html.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ The following arguments are supported:
5959
* `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`.
6060
* `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`.
6161
* `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.
62+
* `segment_type` - (Optional, String) Segment type, valid when Format is HLS, optional values:
63+
- ts: ts segment;
64+
- fmp4: fmp4 segment;
65+
Default value: ts.
6266
* `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.
6367

6468
The `audio` object of `stream_info` supports the following:

website/docs/r/vod_procedure_template.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ The following arguments are supported:
155155
The `adaptive_dynamic_streaming_task_list` object of `media_process_task` supports the following:
156156

157157
* `definition` - (Required, String) Adaptive bitrate streaming template ID.
158+
* `subtitle_list` - (Optional, List) Subtitle list, element is subtitle ID, support multiple subtitles, up to 16.
158159
* `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.
159160

160161
The `ai_analysis_task` object supports the following:
@@ -212,6 +213,7 @@ The `mosaic_list` object of `transcode_task_list` supports the following:
212213

213214
The `review_audio_video_task` object supports the following:
214215

216+
* `definition` - (Optional, String) Review template.
215217
* `review_contents` - (Optional, List) The type of moderated content. Valid values:
216218
- `Media`: The original audio/video;
217219
- `Cover`: Thumbnails.

website/tencentcloud.erb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5881,9 +5881,6 @@
58815881
<li>
58825882
<a href="/docs/providers/tencentcloud/r/vod_sub_application.html">tencentcloud_vod_sub_application</a>
58835883
</li>
5884-
<li>
5885-
<a href="/docs/providers/tencentcloud/r/vod_super_player_config.html">tencentcloud_vod_super_player_config</a>
5886-
</li>
58875884
<li>
58885885
<a href="/docs/providers/tencentcloud/r/vod_transcode_template.html">tencentcloud_vod_transcode_template</a>
58895886
</li>

0 commit comments

Comments
 (0)