直播IM
获取直播信息列表
分页获取直播信息列表。返回直播信息的同时也会返回所属直播间信息,如果直播已结束且有回放,则自动返回回放视频列表。
- URL:
/app-api/txlive/live/getLiveRoomLivingPage - Method:
POST - 需要鉴权:是
请求参数
| 参数 | 类型 | 约束 | 说明 |
|---|---|---|---|
| liveName | String | - | 直播标题,搜索时传值 |
| status | Long | - | 直播状态,0-未开始,1-正在直播,2-已结束(回放) |
| pageNo | Long | - | 页码 |
| pageSize | Long | - | 页大小,默认 10,传 -1 不分页 |
请求示例
{
"liveName": "台球桌布的保养与维护",
"status": 2,
"pageNo": 1,
"pageSize": 10
}
响应示例
{
"code": 0,
"data": {
"list": [
{
"liveRoomBaseInfoRespVO": {
"id": 2,
"memberUserId": 250,
"isAuthentication": 1,
"roomName": "直播间一",
"description": "简介简介",
"discussant": "吕国栋",
"liveType": 1,
"createTime": 1702869343000
},
"liveBaseInfoRespVO": {
"id": 109,
"liveRoomId": 2,
"liveName": "台球桌布的保养与维护",
"coverImg": "https://example.com/cover.png",
"description": "台球桌布的保养与维护",
"startTime": 1713241536000,
"endTime": 1715833500000,
"pushUrl": "rtmp://livepush.example.com/app/stream",
"playUrl": "https://liveplay.example.com/app/stream.m3u8",
"type": 2,
"status": 2,
"playTimes": 0,
"likeTimes": 0,
"streamName": "pVtRtDhvVpi49xZr",
"createTime": 1713251198000
},
"baseRecordInfoRespVOList": [
{
"id": 116,
"streamId": "pVtRtDhvVpi49xZr",
"fileId": "1397757889193499215",
"duration": 6158,
"fileSize": 736813560,
"videoUrl": "https://example.com/video.mp4",
"createTime": 1713277564000
}
]
}
],
"total": 1
},
"msg": "成功"
}
响应说明
直播间信息(liveRoomBaseInfoRespVO):
| 参数 | 类型 | 说明 |
|---|---|---|
| id | Long | 数据编号 |
| memberUserId | Long | 用户编号 |
| isAuthentication | Long | 是否实名认证 |
| roomName | String | 直播间名称 |
| description | String | 直播间介绍 |
| discussant | String | 嘉宾 |
| liveType | Long | 直播类型,1-个人,2-商户,3-官方 |
| createTime | Long | 创建时间 |
直播信息(liveBaseInfoRespVO):
| 参数 | 类型 | 说明 |
|---|---|---|
| id | Long | 数据编号 |
| liveRoomId | Long | 直播间数据编号 |
| liveName | String | 直播名称 |
| coverImg | String | 直播封面 |
| description | String | 直播描述 |
| startTime | Long | 开始时间 |
| endTime | Long | 结束时间 |
| pushUrl | String | 推流地址 |
| pushUrlQr | String | 推流地址二维码 |
| playUrl | String | 直播播放地址 |
| type | Long | 直播类型 |
| status | Long | 直播状态,0-未开始,1-直播中,2-已结束 |
| playTimes | Long | 播放次数 |
| likeTimes | Long | 点赞次数 |
| virtualPlayTimes | Long | 虚拟播放次数(与真实值相加展示) |
| virtualLikeTimes | Long | 虚拟点赞次数(与真实值相加展示 ) |
| streamName | String | 推流名称 |
| safeUrl | String | 签名 URL |
| playEndpoint | String | 播放域名 |
| isMain | Long | 是否封面轮播图,0-否,1-是 |
| createTime | Long | 创建时间 |
回放视频列表(baseRecordInfoRespVOList):
| 参数 | 类型 | 说明 |
|---|---|---|
| id | Long | 数据编号 |
| streamId | String | 直播流名称 |
| channelId | String | 同直播流名称 |
| fileId | String | 点播 fileID |
| recordFileId | String | 点播文件 ID |
| duration | Long | 录制文件时长,单位:秒 |
| fileSize | Long | 录制文件大小 |
| videoUrl | String | 播放地址 |
| streamParam | String | 推流 URL 参数 |
| createTime | Long | 回放视频录制成功时间 |
获取 APP 下所有群组
获取当前 APP 下的所有群组列表。
- 后台接口:
/admin-api/txlive/im/getAppidGroupList - APP 接口:
/app-api/txlive/im/getAppidGroupList - Method:
GET - 需要鉴权:是
请求参数
无请求参数。
请求示例
GET /app-api/txlive/im/getAppidGroupList
响应示例
{
"code": 0,
"data": {
"totalCount": 5,
"groupIdList": [
{
"type": null,
"groupId": "pVtRtDhvVpi49xZr",
"introduction": null,
"notification": null,
"name": null
}
],
"errorInfo": "",
"actionStatus": "OK",
"errorCode": 0
},
"msg": "成功"
}
响应说明
| 参 数 | 类型 | 说明 |
|---|---|---|
| totalCount | Integer | 群组数量 |
| groupId | String | 群组 ID |
| type | String | 群组形态(Public/Private/ChatRoom/AVChatroom 等) |
| introduction | String | 群组介绍 |
| notification | String | 群组公告 |
| name | String | 群组名称 |
说明
本接口只返回群组 ID 列表,如需详细信息请调用「获取群组详细信息」接口。
获取群组详细信息
获取指定群组的详细信息,包括成员列表。
- 后台接口:
/admin-api/txlive/im/getGroupInfo - APP 接口:
/app-api/txlive/im/getGroupInfo - Method:
POST - 需要鉴权:是
请求参数
| 参数 | 类型 | 约束 | 说明 |
|---|---|---|---|
| groupId | String | 必传 | 群组编号 |
请求示例
{
"groupId": "pVtRtDhvVpi49xZr"
}
响应示例
{
"code": 0,
"data": {
"groupInfo": [
{
"memberNum": 29,
"maxMemberNum": 1000,
"memberList": [
{
"nickname": "小鲸",
"avatar": "https://example.com/avatar.jpg",
"role": "Member",
"member_Account": "294",
"joinTime": 1733998288,
"muteUntil": 0,
"lastSendMsgTime": 0
}
],
"type": "AVChatRoom",
"groupId": "pVtRtDhvVpi49xZr",
"notification": "",
"introduction": "",
"name": "直播1",
"errorCode": 0
}
]
},
"msg": "成功"
}
响应说明
| 参数 | 类型 | 说明 |
|---|---|---|
| memberNum | Integer | 群组当前人数 |
| maxMemberNum | Integer | 群组最大人数(直播群聊无上限) |
| type | String | 群组形态 |
| groupId | String | 群组 ID |
| introduction | String | 群组介绍 |
| notification | String | 群组公告 |
| name | String | 群组名称 |
成员列表(memberList):
| 参数 | 类型 | 说明 |
|---|---|---|
| nickname | String | 群成员昵称 |
| avatar | String | 群成员头像 |
| role | String | 群成员角色 |
| member_Account | String | 群成员 ID |
| joinTime | Long | 加入群组时间 |
| muteUntil | Integer | 禁言截止时间戳,0 表示未被禁言 |
| lastSendMsgTime | Long | 最后发送信息时间 |
修改群组信息
修改群组的基本信息。
- 后台接口:
/admin-api/txlive/im/modifyGroupBaseInfo - APP 接口:
/app-api/txlive/im/modifyGroupBaseInfo - Method:
POST - 需要鉴权:是
请求参数
| 参数 | 类型 | 约束 | 说明 |
|---|---|---|---|
| groupId | String | 必传 | 群组编号 |
| name | String | - | 群名称 |
| introduction | String | - | 群介绍 |
| notification | String | - | 群公告 |
| faceUrl | String | - | 群头像地址 |
| muteAllMember | String | - | 全员禁言,On-禁言,Off-非禁言 |
请求示例
{
"groupId": "pVtRtDhvVpi49xZr",
"name": "New Name",
"introduction": "New Introduction",
"notification": "New Notification",
"faceUrl": "https://example.com/face.jpg",
"muteAllMember": "On"
}
响应示例
{
"code": 0,
"data": true,
"msg": "成功"
}
响应说明
| 参数 | 类型 | 说明 |
|---|---|---|
| data | Boolean | true 成功,false 失败 |
批量禁言/取消禁言群成员
对群组成员进行批量禁言或取消禁言操作。
- 后台接口:
/admin-api/txlive/im/forbidSendMsg - APP 接口:
/app-api/txlive/im/forbidSendMsg - Method:
POST - 需要鉴权:是
请求参数
| 参数 | 类型 | 约束 | 说明 |
|---|---|---|---|
| groupId | String | 必传 | 群组编号 |
| members_Account | Array | 必传 | 需要禁言的用户账号,最多 500 个 |
| muteTime | Long | 必传 | 禁言时间(秒),0 表示取消禁言,4294967295 为永久禁言 |
请求示例
{
"groupId": "pVtRtDhvVpi49xZr",
"members_Account": ["253", "w52ddz"],
"muteTime": 100
}
响应示例
{
"code": 0,
"data": true,
"msg": "成功"
}
响应说明
| 参数 | 类型 | 说明 |
|---|---|---|
| data | Boolean | true 成功,false 失败 |
获取被禁言群成员列表
获取群组中被禁言的成员列表。
- 后台接口:
/admin-api/txlive/im/getGroupMutedAccount - APP 接口:
/app-api/txlive/im/getGroupMutedAccount - Method:
POST - 需要鉴权:是
请求参数
| 参数 | 类型 | 约束 | 说明 |
|---|---|---|---|
| groupId | String | 必传 | 群组编号 |
请求示例
{
"groupId": "pVtRtDhvVpi49xZr"
}
响应示例
{
"code": 0,
"data": {
"mutedAccountList": [
{
"nickname": "吕国栋",
"avatar": "https://example.com/avatar.jpg",
"member_Account": "305",
"mutedUntil": "1734984469"
}
]
},
"msg": "成功"
}
响应说明
| 参数 | 类型 | 说明 |
|---|---|---|
| mutedAccountList | Array | 禁言用户信息数组 |
| mutedUntil | Long | 禁言截止时间(UTC 时间戳) |
| member_Account | String | 被禁言账号 |
| nickname | String | 昵称 |
| avatar | String | 头像 |
获取群在线人数
获取群组当前在线人数。
- 后台接口:
/admin-api/txlive/im/getOnlineMemberNum - APP 接口:
/app-api/txlive/im/getOnlineMemberNum - Method:
POST - 需要鉴权:是
请求参数
| 参数 | 类型 | 约束 | 说明 |
|---|---|---|---|
| groupId | String | 必传 | 群组编号 |
请求示例
{
"groupId": "pVtRtDhvVpi49xZr"
}
响应示例
{
"code": 0,
"data": 0,
"msg": "成功"
}
响应说明
| 参数 | 类型 | 说明 |
|---|---|---|
| data | Long | 在线人数 |
获取直播点赞数
获取当前直播的点赞数和播放数。
- 后台接口:
/admin-api/txlive/live-base-info/getLiveLikePlayTimesAdmin - APP 接口:
/app-api/txlive/live/getLiveLikePlayTimesInfo - Method:
POST - 需要鉴权:是
请求参数
| 参数 | 类型 | 约束 | 说明 |
|---|---|---|---|
| id | Long | 必传 | 直播数据编号 |
请求示例
{
"id": 109
}
响应示例
{
"code": 0,
"data": {
"id": 109,
"playTimes": 20,
"likeTimes": 12109,
"virtualPlayTimes": 0,
"virtualLikeTimes": 0
},
"msg": "成功"
}
响应说明
| 参数 | 类型 | 说明 |
|---|---|---|
| id | Long | 当前直播数据编号 |
| playTimes | Long | 播放次数 |
| likeTimes | Long | 点赞次数 |
| virtualPlayTimes | Long | 虚拟播放次数 |
| virtualLikeTimes | Long | 虚拟点赞次数 |
| status | Long | 直播状态,0-未开始,1-直播中,2-已结束 |
| recordEvent | String | 直播录制状态 |
说明
直播实际点赞次数 = likeTimes + virtualLikeTimes。