跳到主要内容

更新直播频道

服务地址

http://api-az-cn.danghongyun.com/rest

请求方法

POST

请求参数

参数说明类型是否必须
accessKey访问接口的accessKeyString必选
actionAPI名称,此接口为 "liveUpdate"String必选
versionAPI版本,目前必须为 2.0String必选
signature签名,请参考签名规则String必选
timestampAPI调用时间戳,1970年1月1日以来的毫秒数,如 1466488681033String必选

另外在 HTTP 数据包的 body 中以 JSON 的形式传入直播频道修改的参数,将 Http header 中的 Content-Type 设置为 application/json,具体参数如下:

参数名称是否必须描述
idString, 频道id
nameString, 频道名称
signalTypeString,源流类型 1.推流 2.拉流
pullStreamString,拉流地址,源流类型为拉流时必填
liveTypeInteger,直播类型,0.普通直播 2.VR直播 3.进阶直播,不传默认跟随模版类型
typeNameString, 类型名称
typeString, 频道类型(为直播分类id==typeid)
outputGroupList.idString,输出组Id,不填时会把原输出组清除并创建新的输出组,如需保持原播放地址不变必须带上此Id
outputGroupList.protocolTypeInteger,直播输出组协议类型 1.hls 2.rtmp
outputGroupList.rtmpThirdPartyOutputUrlString,第三方推流地址,rtmp协议下可以选填
outputGroupList.rotationString,画面旋转度数。取值0或90或270
outputGroupList.isRecordString,是否启用录制,0.不启用 1.启用,默认0
outputGroupList.needToMp4String,录制的文件是否转mp4,0.否 1.是,默认0
outputGroupList.isTimeShiftString,是否启用时移,0.不启用 1.启用,默认0。只有HLS协议下才可以启用时移
outputGroupList.timeShiftDurationString,时移时长,在启用时移的情况下必填(单位小时)
outputGroupList.isLiveEncryptString,是否启用加密,0.不启用 1.启用,默认0。,只有HLS协议下才可以启用加密
outputGroupList.logoIdString,直播logoId
outputGroupList.outputTemplateList.templateIdString,直播模板id
outputGroupList.outputTemplateList.isDefaultString,是否默认,0.否 1.是

请求示例

{
"id":"377fc5664a8a4af189d3cec73aef1d76",
"name": "test modify the normal channel",
"signalType": 1,
"liveType": 0,
"outputGroupList": [{
"protocolType": "1",
"isRecord": "1",
"isTimeShift": "1",
"timeShiftDuration": "2",
"isLiveEncrypt": "0",
"logoId": "",
"outputTemplateList": [{
"id":"0cc3b075ff2f49f7bd2bae698adee749",
"templateId": "786ee85ebb7c4dad8e75bc836a55a948",
"isDefault": "0"
},
{
"templateId": "6c01632990dc412b911cc7ba0b45885a",
"isDefault": "1"
}]
},
{
"protocolType": "2",
"isRecord": "1",
"outputTemplateList": [{
"templateId": "6c01632990dc412b911cc7ba0b45885a",
"isDefault": "1"
}]
}]
}

响应示例

{
"code": 0,
"message": "operation success",
"result": {
"id": "377fc5664a8a4af189d3cec73aef1d76",
"name": "test modify the normal channel",
"description": null,
"type": null,
"typeName": null,
"signalType": "1",
"stream": "p1u0enox_h27zhXg5",
"pullStream": null,
"pullTaskId": null,
"status": 0,
"streamStatus": 2,
"userId": 106,
"streamWidth": null,
"streamHeight": null,
"streamBitrate": null,
"streamAudioBitrate": null,
"streamFrameRate": null,
"createTime": 1542693039000,
"updateTime": 1542695148000,
"startTime": null,
"endTime": null,
"autoEndTime": null,
"thumbnailUrl": "http://p1u0enox.images.danghongyun.local/thumbnail/377fc5664a8a4af189d3cec73aef1d76.jpg",
"pushUrl": "rtmp://rtmp-push.danghongyun.dev/live/p1u0enox_h27zhXg5",
"publicPlayUrl": "rtmp://172.17.230.223/live/p1u0enox_h27zhXg5",
"publicFlvPlayUrl": "http://172.17.230.223:1936/live/p1u0enox_h27zhXg5.flv",
"liveType": 0,
"deviceId": null,
"fillInfo": null,
"outputGroupList": [{
"id": "049c1e882cea4faca68cfddcb54b845e",
"name": null,
"protocolType": 2,
"channelId": "377fc5664a8a4af189d3cec73aef1d76",
"taskId": null,
"isLiveEncrypt": null,
"customerId": null,
"contentId": null,
"createTime": 1542695148000,
"updateTime": 1542695148000,
"liveLogoId": null,
"liveLogo": null,
"logoId": null,
"rtmpThirdPartyOutputUrl": null,
"isRecord": "1",
"recordTaskId": null,
"recordStartTime": null,
"needToMp4": null,
"isTimeShift": null,
"timeShiftDuration": null,
"timeShiftTaskId": null,
"rotation": null,
"outputTemplateList": [{
"templateId": null,
"isDefault": null,
"id": "6c01632990dc412b911cc7ba0b45885a",
"displayName": "ordinary",
"transcodeType": 0,
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 2,
"updateTime": null,
"name": "ordinary/270kbps/640x352"
}],
"liveOutputs": [{
"id": "11c398e6e4a94bb8b0798128eb9ebc51",
"publicOutputUrl": "rtmp://172.17.230.223/live/p1u0enox_049c1e882cea4faca68cfddcb54b845e",
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"protocolType": 2,
"userId": 106,
"channelId": "377fc5664a8a4af189d3cec73aef1d76",
"liveOutputGroupId": "049c1e882cea4faca68cfddcb54b845e",
"liveTemplateId": "6c01632990dc412b911cc7ba0b45885a",
"createTime": 1542695148000,
"updateTime": null,
"isDefault": "1"
}]
},
{
"id": "7327f98aca74472286b217f66ed8e3c0",
"name": null,
"protocolType": 1,
"channelId": "377fc5664a8a4af189d3cec73aef1d76",
"taskId": null,
"isLiveEncrypt": "0",
"customerId": null,
"contentId": null,
"createTime": 1542695148000,
"updateTime": 1542695148000,
"liveLogoId": "",
"liveLogo": null,
"logoId": null,
"rtmpThirdPartyOutputUrl": null,
"isRecord": "1",
"recordTaskId": null,
"recordStartTime": null,
"needToMp4": null,
"isTimeShift": "1",
"timeShiftDuration": "2",
"timeShiftTaskId": null,
"rotation": null,
"outputTemplateList": [{
"templateId": null,
"isDefault": null,
"id": "786ee85ebb7c4dad8e75bc836a55a948",
"displayName": "standard definition",
"transcodeType": 0,
"videoWidth": 720,
"videoHeight": 576,
"videoBitrate": 450,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 3,
"updateTime": null,
"name": "standard definition/450kbps/720x576"
},
{
"templateId": null,
"isDefault": null,
"id": "6c01632990dc412b911cc7ba0b45885a",
"displayName": "ordinary",
"transcodeType": 0,
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 2,
"updateTime": null,
"name": "ordinary/270kbps/640x352"
}],
"liveOutputs": [{
"id": "2816f1bdbcf24214aa80faa1f880dd8e",
"publicOutputUrl": "http://p1u0enox.live1.danghongyun.local/live/hls/377fc5664a8a4af189d3cec73aef1d76/7327f98aca74472286b217f66ed8e3c0.m3u8",
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"protocolType": 1,
"userId": 106,
"channelId": "377fc5664a8a4af189d3cec73aef1d76",
"liveOutputGroupId": "7327f98aca74472286b217f66ed8e3c0",
"liveTemplateId": "6c01632990dc412b911cc7ba0b45885a",
"createTime": 1542695148000,
"updateTime": null,
"isDefault": "1"
},
{
"id": "a1646f60bc05431d89f0d878372357ff",
"publicOutputUrl": "http://p1u0enox.live1.danghongyun.local/live/hls/377fc5664a8a4af189d3cec73aef1d76/7327f98aca74472286b217f66ed8e3c0.m3u8",
"videoWidth": 720,
"videoHeight": 576,
"videoBitrate": 450,
"audioBitrate": 64,
"protocolType": 1,
"userId": 106,
"channelId": "377fc5664a8a4af189d3cec73aef1d76",
"liveOutputGroupId": "7327f98aca74472286b217f66ed8e3c0",
"liveTemplateId": "786ee85ebb7c4dad8e75bc836a55a948",
"createTime": 1542695148000,
"updateTime": null,
"isDefault": "0"
}]
}]
},
"success": true
}

响应字段说明

参见直播频道信息