更新全局字幕样,需要注意的是已经被修改样式的单条字幕会优先与全局样式。(当设置了全局有字幕不生效时,需要查看这条字幕是否已经被设置了样式,可通过 ListSubtitle 接口中查看字幕的targetStyle、sourceStyle是否有值,有值表示被设置过)
下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。
参数 | 类型 | 是否必填 | 示例值 | 描述 |
|---|---|---|---|---|
Action | String | 是 | VideoEditorUpdateGlobalStyle | 要执行的操作,取值:VideoEditorUpdateGlobalStyle。 |
Version | String | 是 | 2021-05-21 | API的版本,取值:2021-05-21。 |
subtaskId | String | 否 | 12345 | 子任务ID |
style | String | 否 | {\"source\":{\"alignment\":1,\"anchorX\":0,\"anchorY\":0,\"backgroundAlpha\":0,\"backgroundColor\":\"#000000\",\"borderColor\":\"#000000\",\"borderWidth\":0.05,\"color\":\"rgba(255, 255, 255, 1)\",\"fontFamily\":\"fz_lantingzhonghei_jianti\",\"fontIndex\":1,\"fontSize\":14,\"lineMaxWidth\":0.84836,\"marginBottom\":11,\"marginLeft\":37,\"marginRight\":37,\"maskBackgroundColor\":\"rgba(0, 0, 0, 0)\",\"show\":false,\"textAlign\":\"center\",\"textAlpha\":1,\"textColor\":\"#FFFFFF\",\"x\":0,\"y\":-0.9},\"target\":{\"alignment\":1,\"anchorX\":0,\"anchorY\":0,\"backgroundAlpha\":0,\"backgroundColor\":\"#000000\",\"borderColor\":\"#000000\",\"borderWidth\":0.05,\"color\":\"rgba(231, 235, 77, 0.73)\",\"fontFamily\":\"loki://9893366\",\"fontIndex\":5,\"fontSize\":14,\"lineMaxWidth\":0.84836,\"marginBottom\":29,\"marginLeft\":37,\"marginRight\":37,\"maskBackgroundColor\":\"rgba(0, 0, 0, 0)\",\"show\":true,\"textAlign\":\"center\",\"textAlpha\":0.73,\"textColor\":\"#e7eb4d\",\"version\":\"1\",\"x\":-0.001077097505668933,\"y\":-0.6}} | 字幕默认样式,需要注意需要包含 原文source、译文 target 字幕样式 |
本接口无特有的返回参数。更多信息请见返回结构。
POST /?Action=VideoEditorUpdateGlobalStyle&Version=2021-05-21 HTTP/1.1 Host: open.volcengineapi.com Content-Type: application/json; charset=UTF-8 X-Date: 20260323T091125Z X-Content-Sha256: 287e874e******d653b44d21e Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20260323/cn-beijing/i18n_openapi/request, SignedHeaders=host;x-content-sha256;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f {"subtaskId":"12345","style":"{\"fontSize\":16,\"color\":\"#ffffff\"}"}
{"ResponseMetadata":{"RequestId":"2026032317112912311503601596D968","Action":"VideoEditorUpdateGlobalStyle","Version":"2021-05-21","Service":"i18n_openapi","Region":"cn-beijing"},"Result":{}}
您可访问公共错误码,获取更多错误码信息。