添加導播台組件。
介面說明
請先建立導播台、瞭解導播台的布局列表後再調用本介面添加導播台組件。本介面目前支援添加圖片、文字、字幕三類組件。使用 API 建立導播台,請參見建立導播台。
QPS 限制
本介面的單使用者 QPS 限制為 10 次/秒。超過限制,API 呼叫會被限流,這可能會影響您的業務,請合理調用。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
live:AddCasterComponent |
create |
*Caster
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| RegionId |
string |
否 |
地區 ID。 |
cn-shanghai |
| CasterId |
string |
是 |
導播台 ID。
說明
直播控制台雲導播台頁面導播台列表中的導播台名稱即導播台 ID。 |
LIVEPRODUCER_POST-cn-0pp1czt**** |
| ComponentName |
string |
否 |
組件名稱。預設為組件 ID。 |
text01 |
| LocationId |
string |
是 |
用於指定組件位置,每個位置至多設定一個組件,格式需符合“RC01~RC99”。 說明
組件類型為 caption 時,表示引用的視頻源 Location。 |
RC01 |
| ComponentType |
string |
是 |
組件類型。取值:
|
text |
| Effect |
string |
否 |
組件顯示的特效 。取值:
|
animateH |
| ComponentLayer |
string |
是 |
該組件 Layer 的尺寸,布局等資訊。設定元素說明如下:
JSON 格式字串,參數名採用首字母大寫、駝峰格式。 |
{"HeightNormalized":"1","PositionRefer":"topRight","WidthNormalized":"0","PositionNormalized":["0.1","0.2"]} |
| LayerOrder |
string |
否 |
組件層疊次序。
|
cover |
| TextLayerContent |
string |
否 |
Layer 元素屬性。元素屬性說明如下: 重要 當 ComponentType 為 text 時,本參數才可用且必傳。
JSON 格式字串,參數名採用首字母大寫,駝峰格式。 |
{"BorderWidthNormalized":"1","SizeNormalized":"0.2","Color":"0x000000","FontName":"KaiTi","BorderColor":"0x000000","Text":"hello world!"} |
| ImageLayerContent |
string |
否 |
Layer 元素屬性。元素屬性說明如下: 重要 ComponentType 為 image 時,該參數必傳。 MaterialId:媒資庫素材 ID。上傳素材時設定的名稱就是媒資庫素材 ID。 JSON 格式字串,參數名採用首字母大寫,駝峰格式。 |
{"MaterialId":"6cf724c6ebfd4a59b5b3cec6f10d****"} |
| CaptionLayerContent |
string |
否 |
Layer 元素屬性。元素屬性說明如下: 重要 當 ComponentType 為 caption 時,該參數必傳。
JSON 格式字串,參數名採用首字母大寫,駝峰格式。 |
{"BorderWidthNormalized":0.01,"SizeNormalized":0.05,"Color":"0x000000","LocationId":"RV01","SourceLan":"cn","FontName":"KaiTi","BorderColor":"0xffffff"} |
| HtmlLayerContent |
string |
否 |
H5 組件配置。 |
{"htmlUrl":http://caster.example.com} |
雲導播字型說明
| 字型 | FontName 取值 |
| 楷體 | KaiTi |
| 阿里巴巴普惠體-常規 | AlibabaPuHuiTi-Regular |
| 阿里巴巴普惠體-粗體 | AlibabaPuHuiTi-Bold |
| 阿里巴巴普惠體-細體 | AlibabaPuHuiTi-Light |
| 思源黑體-常規 | NotoSansHans-Regular |
| 思源黑體-粗體 | NotoSansHans-Bold |
| 思源黑體-細體 | NotoSansHans-Light |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| ComponentId |
string |
組件 ID。可作為查詢導播台組件、修改導播台組件、刪除導播台組件的請求參數。 |
21926b36-7dd2-4fde-ae25-51b5bc8e**** |
| RequestId |
string |
請求 ID。 |
16A96B9A-F203-4EC5-8E43-CB92E68F4CD8 |
樣本
正常返回樣本
JSON格式
{
"ComponentId": "21926b36-7dd2-4fde-ae25-51b5bc8e****",
"RequestId": "16A96B9A-F203-4EC5-8E43-CB92E68F4CD8"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | InvalidUserId.Malformed | %s, please check userId. | 傳入的userId無效,請檢查。 |
| 400 | InvalidCasterId.Malformed | %s, please check and try again later. | 參數CasterId無效,請檢查後重試。 |
| 400 | MissingParameter | %s. | 參數缺失 |
| 400 | InvalidParameter.Malformed | There are invalid parameters: %s. | 存在無效參數:%s。 |
| 400 | InvalidPositionNormalized.Malformed | %s, please check and try again later. | 參數PositionNormalized無效,請檢查後重試。 |
| 400 | DuplicateLocationID | %s, please check and try again later. | 參數LocationID重複,請檢查後重試。 |
| 401 | IllegalOperation | %s, please check and try again later. | 不允許的操作,請檢查後重試。 |
| 500 | InternalError | %s, please try again later. | 內部錯誤,請稍後重試。 |
| 404 | InvalidCaster.NotFound | %s, please check and try again later. | 導播台不存在,請檢查後重試。 |
| 404 | CanvasNotExist | %s, please check and try again later. | Canvas不存在,請檢查後重試。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。