json格式,对应云直播控制台->推流设置->回调body编码格式json
当RTMP推流成功后,会调用相应的回调接口,回调内容如下:
参数 | 类型 | 描述 | 示例 |
---|---|---|---|
Version | String | 版本号 | 1.0 |
App | String | 频道 | live |
Pubdomain | String | 推流域名 | xxx.xxx.com |
Stream | String | 流名 | 123 |
PubStartUnixTime | String | 推流开始时间,13位unixtime毫秒时间戳,注:历史原因,开关播回调时间戳类型不一致,如需改成int类型请联系售后 | 1456800010000 |
NotifyType | String | 回调类型,PubStart:推流开始,PubEnd:推流结束 | PubStart |
PubParam | Object | 推流携带的参数 | |
ClientIp | String | 推流端IP | |
ClientPort | Int | 推流端端口 | |
Node | String | cdn接受流的节点 |
{
"Version":"1.0",
"App":"live",
"Pubdomain":"xxx.xxx.com",
"Stream":"test",
"PubStartUnixTime":"1456800010000",
"NotifyType":"PubStart",
"ClientIp":" ",
"ClientPort":" ",
"Node":" ",
"PubParam":{
"param1":"123456",
"param2":11
}
}
当RTMP推流结束后,会调用相应的回调接口,回调内容如下:
参数 | 类型 | 描述 | 示例 |
---|---|---|---|
Version | String | 版本号 | 1.0 |
App | String | 频道 | live |
Pubdomain | String | 推流域名 | xxx.xxx.com |
Stream | String | 流名 | 123 |
PubEndUnixTime | Int | 推流结束时间,13位unixtime毫秒时间戳 | 1456800010000 |
NotifyType | String | 回调类型,PubStart:推流开始,PubEnd:推流结束 | PubEnd |
PubParam | Object | 推流携带的参数 | |
ClientIp | String | 推流端IP | |
ClientPort | int | 推流端端口 | |
Node | String | cdn接受流的节点 |
{
"Version":"1.0",
"App":"live",
"Pubdomain":"xxx.xxx.com",
"Stream":"test",
"PubEndUnixTime":1456800010000,
"NotifyType":"PubEnd",
"ClientIp":" ",
"ClientPort":" ",
"Node":" ",
"PubEndMessage":" ",
"PubParam":{
"param1":"123456",
"param2":11
}
}
string格式,对应云直播控制台->推流设置->回调body编码格式string
当RTMP推流成功后,会调用相应的回调接口,回调接口具体的结构如介绍中所描述。
HTTP Body
app=live&name=asdf&swfurl=nil&flashver=nil&tcurl=rtmp://test.uplive.ks-cdn.com/live&call=user_publish&vdoid=123456
回调接口包括流所属的频道app,流名name,推流时携带的flashver & swfurl & tcurl,以及本次请求的类型call。对于推流开始,call的值为user_publish;对于推流结束,call的值为user_publish_done。
参数 | 示例 | 描述 |
---|---|---|
app | live | 频道 |
name | asd | 流名 |
flashver | MAC 10,2,153,2 | 用于播放SWF文件的Flash播放器版本 |
swfurl | swl文件播放url,无默认值 | |
tcurl | rtmp://test.uplive.ks-cdn.com/live/stream | 推流url |
call | user_publish | 请求类型(推流开始:user_publish;推流结束:user_publish_done) |
vdoid | 123 | 用于标识文件是否拼接 |
当RTMP推流结束后,会调用相应的回调接口,回调接口具体的结构如介绍中所描述。
HTTP头
POST /callback HTTP/1.0
Host: 用户提供的通知Host
Connection: close
Content-Length: 128
HTTP Body
app=live&name=asdf&swfurl=nil&flashver=nil&tcurl=rtmp://test.uplive.ks-cdn.com/live&call=user_publish_done&close_mode=nil&vdoid=123456
参数 | 示例 | 描述 |
---|---|---|
app | live | 频道 |
name | asd | 流名 |
flashver | MAC 10,2,153,2 | 用于播放SWF文件的Flash播放器版本 |
swfurl | swl文件播放url,无默认值 | |
tcurl | rtmp://test.uplive.ks-cdn.com/live/stream | 推流url |
call | user_publish | 请求类型(推流开始:user_publish;推流结束:user_publish_done) |
close_mode | 1 | 推流断开类型(1:正常断开,2:异常断开) |
vdoid | 123 | 用于标识相同流名的不同次推流 |
Error | Description |
---|---|
AuthencationFailed | 鉴权失败 |
NonExistApplication | app频道不存在 |
ExistStreamName | publish流名已存在 |
文档内容是否对您有帮助?
评价建议不能为空
非常感谢您的反馈,我们会继续努力做到更好!