本地视频直接推送到 Cloudflare WHIP:
维护人:TG Live
POST http://localhost:10050/api/stream/local/startPOST https://tg-live-game.pwtk.cc/api/stream/local/start描述:启动本地视频推流
ContentType:application/json
| 名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
|---|---|---|---|---|---|
| streamName | String | 否 | - | 流名称(唯一标识) | |
| videoPath | String | 否 | - | 视频文件路径 | |
| loop | Boolean | 否 | - | 是否循环播放 | true |
| targetChannelId | String | 否 | - | 目标推流通道 ID(可选,不传则使用默认通道) |
{
"streamName": "string",
"videoPath": "string",
"loop": true,
"targetChannelId": "string"
}
| 名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
|---|---|---|---|---|---|
| success | Boolean | 否 | - | 请求是否成功 | true |
| errCode | String | 否 | - | 错误码(失败时返回) | |
| errMessage | String | 否 | - | 错误信息(失败时返回) | |
| data | object | 否 | 响应数据 (ActualType: LocalVideoStreamDTO) | ||
| └ streamName | String | 否 | - | 流名称 | |
| └ sourceType | String | 否 | - | 源类型:local_video 或 rtsp_camera | |
| └ sourcePath | String | 否 | - | 源路径(视频文件路径或 RTSP URL) | |
| └ rtspUrl | String | 否 | - | MediaMTX 提供的 RTSP URL | |
| └ loop | Boolean | 否 | - | 是否循环播放 | true |
| └ streamTaskId | String | 否 | - | 推流任务 ID(如果已推送到 Cloudflare) | |
| └ playbackUrl | String | 否 | - | 播放地址(Cloudflare HLS/WHEP) | |
| └ status | String | 否 | - | 状态 |
{
"success": true,
"errCode": "string",
"errMessage": "string",
"data": {
"streamName": "string",
"sourceType": "string",
"sourcePath": "string",
"rtspUrl": "string",
"loop": true,
"streamTaskId": "string",
"playbackUrl": "string",
"status": "string"
}
}
无
维护人:TG Live
POST http://localhost:10050/api/stream/local/stopPOST https://tg-live-game.pwtk.cc/api/stream/local/stop描述:停止本地视频推流
ContentType:application/x-www-form-urlencoded;charset=UTF-8
| 名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
|---|---|---|---|---|---|
| streamName | string | 是 | - | No comments found. |
| 名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
|---|---|---|---|---|---|
| success | Boolean | 否 | - | 请求是否成功 | true |
| errCode | String | 否 | - | 错误码(失败时返回) | |
| errMessage | String | 否 | - | 错误信息(失败时返回) | |
| data | object | 否 | - | 响应数据 (ActualType: Void) |
{
"success": true,
"errCode": "string",
"errMessage": "string",
"data": {}
}
无
维护人:TG Live
GET http://localhost:10050/api/stream/local/{streamName}GET https://tg-live-game.pwtk.cc/api/stream/local/{streamName}描述:获取本地视频推流状态
ContentType:application/x-www-form-urlencoded;charset=UTF-8
| 名称 | 必填 | 描述 | 示例值 |
|---|---|---|---|
| streamName | 是 | No comments found. |
| 名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
|---|---|---|---|---|---|
| success | Boolean | 否 | - | 请求是否成功 | true |
| errCode | String | 否 | - | 错误码(失败时返回) | |
| errMessage | String | 否 | - | 错误信息(失败时返回) | |
| data | object | 否 | 响应数据 (ActualType: LocalVideoStreamDTO) | ||
| └ streamName | String | 否 | - | 流名称 | |
| └ sourceType | String | 否 | - | 源类型:local_video 或 rtsp_camera | |
| └ sourcePath | String | 否 | - | 源路径(视频文件路径或 RTSP URL) | |
| └ rtspUrl | String | 否 | - | MediaMTX 提供的 RTSP URL | |
| └ loop | Boolean | 否 | - | 是否循环播放 | true |
| └ streamTaskId | String | 否 | - | 推流任务 ID(如果已推送到 Cloudflare) | |
| └ playbackUrl | String | 否 | - | 播放地址(Cloudflare HLS/WHEP) | |
| └ status | String | 否 | - | 状态 |
{
"success": true,
"errCode": "string",
"errMessage": "string",
"data": {
"streamName": "string",
"sourceType": "string",
"sourcePath": "string",
"rtspUrl": "string",
"loop": true,
"streamTaskId": "string",
"playbackUrl": "string",
"status": "string"
}
}
无
维护人:TG Live
GET http://localhost:10050/api/stream/local/listGET https://tg-live-game.pwtk.cc/api/stream/local/list描述:获取所有本地视频推流
ContentType:application/x-www-form-urlencoded;charset=UTF-8
| 名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
|---|---|---|---|---|---|
| success | Boolean | 否 | - | 请求是否成功 | true |
| errCode | String | 否 | - | 错误码(失败时返回) | |
| errMessage | String | 否 | - | 错误信息(失败时返回) | |
| data | array | 否 | 响应数据 (ActualType: List) | ||
| └ streamName | String | 否 | - | 流名称 | |
| └ sourceType | String | 否 | - | 源类型:local_video 或 rtsp_camera | |
| └ sourcePath | String | 否 | - | 源路径(视频文件路径或 RTSP URL) | |
| └ rtspUrl | String | 否 | - | MediaMTX 提供的 RTSP URL | |
| └ loop | Boolean | 否 | - | 是否循环播放 | true |
| └ streamTaskId | String | 否 | - | 推流任务 ID(如果已推送到 Cloudflare) | |
| └ playbackUrl | String | 否 | - | 播放地址(Cloudflare HLS/WHEP) | |
| └ status | String | 否 | - | 状态 |
{
"success": true,
"errCode": "string",
"errMessage": "string",
"data": [
{
"streamName": "string",
"sourceType": "string",
"sourcePath": "string",
"rtspUrl": "string",
"loop": true,
"streamTaskId": "string",
"playbackUrl": "string",
"status": "string"
}
]
}
无
推流管理 API 接口:
维护人:TG Live
POST http://localhost:10050/api/stream/startPOST https://tg-live-game.pwtk.cc/api/stream/start描述:启动推流任务
ContentType:application/json
| 名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
|---|---|---|---|---|---|
| name | String | 否 | - | 任务名称 | 投币机 1 号直播 |
| lssId | String | 否 | - | LSS 节点 ID(可选,不传则自动选择) | lss_001 |
| cameraId | String | 否 | - | 摄像头 ID(必填) | cam_001 |
| sourceRtspUrl | String | 否 | - | 源 RTSP 地址(可选,如不传则从摄像头服务获取) | rtsp://admin:password@192.168.1.101:554/stream1 |
| profile | String | 否 | - | 推流配置档位: low_latency / standard / file_loop | low_latency |
| whipUrl | String | 否 | - | WHIP 推流地址 | https://customer-xxx.cloudflarestream.com/xxx/webRTC/publish |
| playbackUrl | String | 否 | - | WebRTC 播放地址 | https://customer-xxx.cloudflarestream.com/xxx/webRTC/play |
| remark | String | 否 | - | 备注 |
{
"name": "投币机1号直播",
"lssId": "lss_001",
"cameraId": "cam_001",
"sourceRtspUrl": "rtsp://admin:password@192.168.1.101:554/stream1",
"profile": "low_latency",
"whipUrl": "https://customer-xxx.cloudflarestream.com/xxx/webRTC/publish",
"playbackUrl": "https://customer-xxx.cloudflarestream.com/xxx/webRTC/play",
"remark": "string"
}
| 名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
|---|---|---|---|---|---|
| success | Boolean | 否 | - | 请求是否成功 | true |
| errCode | String | 否 | - | 错误码(失败时返回) | |
| errMessage | String | 否 | - | 错误信息(失败时返回) | |
| data | object | 否 | 响应数据 (ActualType: StreamTaskDTO) | ||
| └ streamSn | String | 否 | - | 推流任务流水号 | stream_abc123def456 |
| └ name | String | 否 | - | 任务名称 | 投币机 1 号直播 |
| └ lssId | String | 否 | - | LSS 节点 ID | lss_001 |
| └ cameraId | String | 否 | - | 摄像头 ID | cam_001 |
| └ sourceRtspUrl | String | 否 | - | 源 RTSP 地址 | rtsp://admin:password@192.168.1.101:554/stream1 |
| └ profile | String | 否 | - | 推流配置档位: low_latency / standard / file_loop | low_latency |
| └ whipUrl | String | 否 | - | WHIP 推流地址 | https://customer-xxx.cloudflarestream.com/xxx/webRTC/publish |
| └ playbackUrl | String | 否 | - | WebRTC 播放地址 | https://customer-xxx.cloudflarestream.com/xxx/webRTC/play |
| └ status | String | 否 | - | 推流状态: IDLE, STARTING, STREAMING, STOPPED, ERROR | STREAMING |
| └ statusDescription | String | 否 | - | 状态描述 | 推流中 |
| └ errorMessage | String | 否 | - | 错误信息 | |
| └ retryCount | int | 否 | - | 重试次数 | 0 |
| └ remark | String | 否 | - | 备注 | |
| └ createdAt | LocalDateTime | 否 | - | 创建时间 | 2024-01-15T10:30:00 |
| └ startedAt | LocalDateTime | 否 | - | 开始推流时间 | 2024-01-15T10:30:05 |
| └ stoppedAt | LocalDateTime | 否 | - | 停止推流时间 | yyyy-MM-dd HH:mm:ss |
{
"success": true,
"errCode": "string",
"errMessage": "string",
"data": {
"streamSn": "stream_abc123def456",
"name": "投币机1号直播",
"lssId": "lss_001",
"cameraId": "cam_001",
"sourceRtspUrl": "rtsp://admin:password@192.168.1.101:554/stream1",
"profile": "low_latency",
"whipUrl": "https://customer-xxx.cloudflarestream.com/xxx/webRTC/publish",
"playbackUrl": "https://customer-xxx.cloudflarestream.com/xxx/webRTC/play",
"status": "STREAMING",
"statusDescription": "推流中",
"errorMessage": "string",
"retryCount": 0,
"remark": "string",
"createdAt": "2024-01-15T10:30:00",
"startedAt": "2024-01-15T10:30:05",
"stoppedAt": "yyyy-MM-dd HH:mm:ss"
}
}
无
维护人:TG Live
POST http://localhost:10050/api/stream/stopPOST https://tg-live-game.pwtk.cc/api/stream/stop描述:停止推流任务
ContentType:application/json
| 名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
|---|---|---|---|---|---|
| taskId | String | 否 | - | 推流任务流水号(与 lssId 二选一) | stream_abc123def456 |
| lssId | String | 否 | - | LSS 节点 ID(与 taskId 二选一,停止该 LSS 所有推流) | lss_001 |
{
"taskId": "stream_abc123def456",
"lssId": "lss_001"
}
| 名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
|---|---|---|---|---|---|
| success | Boolean | 否 | - | 请求是否成功 | true |
| errCode | String | 否 | - | 错误码(失败时返回) | |
| errMessage | String | 否 | - | 错误信息(失败时返回) | |
| data | object | 否 | - | 响应数据 (ActualType: Void) |
{
"success": true,
"errCode": "string",
"errMessage": "string",
"data": {}
}
无
维护人:TG Live
GET http://localhost:10050/api/stream/task/{streamSn}GET https://tg-live-game.pwtk.cc/api/stream/task/{streamSn}描述:获取任务状态
ContentType:application/x-www-form-urlencoded;charset=UTF-8
| 名称 | 必填 | 描述 | 示例值 |
|---|---|---|---|
| streamSn | 是 | 推流任务流水号 | stream_abc123def456 |
| 名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
|---|---|---|---|---|---|
| success | Boolean | 否 | - | 请求是否成功 | true |
| errCode | String | 否 | - | 错误码(失败时返回) | |
| errMessage | String | 否 | - | 错误信息(失败时返回) | |
| data | object | 否 | 响应数据 (ActualType: StreamTaskDTO) | ||
| └ streamSn | String | 否 | - | 推流任务流水号 | stream_abc123def456 |
| └ name | String | 否 | - | 任务名称 | 投币机 1 号直播 |
| └ lssId | String | 否 | - | LSS 节点 ID | lss_001 |
| └ cameraId | String | 否 | - | 摄像头 ID | cam_001 |
| └ sourceRtspUrl | String | 否 | - | 源 RTSP 地址 | rtsp://admin:password@192.168.1.101:554/stream1 |
| └ profile | String | 否 | - | 推流配置档位: low_latency / standard / file_loop | low_latency |
| └ whipUrl | String | 否 | - | WHIP 推流地址 | https://customer-xxx.cloudflarestream.com/xxx/webRTC/publish |
| └ playbackUrl | String | 否 | - | WebRTC 播放地址 | https://customer-xxx.cloudflarestream.com/xxx/webRTC/play |
| └ status | String | 否 | - | 推流状态: IDLE, STARTING, STREAMING, STOPPED, ERROR | STREAMING |
| └ statusDescription | String | 否 | - | 状态描述 | 推流中 |
| └ errorMessage | String | 否 | - | 错误信息 | |
| └ retryCount | int | 否 | - | 重试次数 | 0 |
| └ remark | String | 否 | - | 备注 | |
| └ createdAt | LocalDateTime | 否 | - | 创建时间 | 2024-01-15T10:30:00 |
| └ startedAt | LocalDateTime | 否 | - | 开始推流时间 | 2024-01-15T10:30:05 |
| └ stoppedAt | LocalDateTime | 否 | - | 停止推流时间 | yyyy-MM-dd HH:mm:ss |
{
"success": true,
"errCode": "string",
"errMessage": "string",
"data": {
"streamSn": "stream_abc123def456",
"name": "投币机1号直播",
"lssId": "lss_001",
"cameraId": "cam_001",
"sourceRtspUrl": "rtsp://admin:password@192.168.1.101:554/stream1",
"profile": "low_latency",
"whipUrl": "https://customer-xxx.cloudflarestream.com/xxx/webRTC/publish",
"playbackUrl": "https://customer-xxx.cloudflarestream.com/xxx/webRTC/play",
"status": "STREAMING",
"statusDescription": "推流中",
"errorMessage": "string",
"retryCount": 0,
"remark": "string",
"createdAt": "2024-01-15T10:30:00",
"startedAt": "2024-01-15T10:30:05",
"stoppedAt": "yyyy-MM-dd HH:mm:ss"
}
}
无
维护人:TG Live
GET http://localhost:10050/api/stream/tasksGET https://tg-live-game.pwtk.cc/api/stream/tasks描述:获取 LSS 推流任务列表
ContentType:application/x-www-form-urlencoded;charset=UTF-8
| 名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
|---|---|---|---|---|---|
| lssId | string | 是 | - | LSS 节点 ID | lss_001 |
| 名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
|---|---|---|---|---|---|
| success | Boolean | 否 | - | 请求是否成功 | true |
| errCode | String | 否 | - | 错误码(失败时返回) | |
| errMessage | String | 否 | - | 错误信息(失败时返回) | |
| data | array | 否 | 响应数据 (ActualType: List) | ||
| └ streamSn | String | 否 | - | 推流任务流水号 | stream_abc123def456 |
| └ name | String | 否 | - | 任务名称 | 投币机 1 号直播 |
| └ lssId | String | 否 | - | LSS 节点 ID | lss_001 |
| └ cameraId | String | 否 | - | 摄像头 ID | cam_001 |
| └ sourceRtspUrl | String | 否 | - | 源 RTSP 地址 | rtsp://admin:password@192.168.1.101:554/stream1 |
| └ profile | String | 否 | - | 推流配置档位: low_latency / standard / file_loop | low_latency |
| └ whipUrl | String | 否 | - | WHIP 推流地址 | https://customer-xxx.cloudflarestream.com/xxx/webRTC/publish |
| └ playbackUrl | String | 否 | - | WebRTC 播放地址 | https://customer-xxx.cloudflarestream.com/xxx/webRTC/play |
| └ status | String | 否 | - | 推流状态: IDLE, STARTING, STREAMING, STOPPED, ERROR | STREAMING |
| └ statusDescription | String | 否 | - | 状态描述 | 推流中 |
| └ errorMessage | String | 否 | - | 错误信息 | |
| └ retryCount | int | 否 | - | 重试次数 | 0 |
| └ remark | String | 否 | - | 备注 | |
| └ createdAt | LocalDateTime | 否 | - | 创建时间 | 2024-01-15T10:30:00 |
| └ startedAt | LocalDateTime | 否 | - | 开始推流时间 | 2024-01-15T10:30:05 |
| └ stoppedAt | LocalDateTime | 否 | - | 停止推流时间 | yyyy-MM-dd HH:mm:ss |
{
"success": true,
"errCode": "string",
"errMessage": "string",
"data": [
{
"streamSn": "stream_abc123def456",
"name": "投币机1号直播",
"lssId": "lss_001",
"cameraId": "cam_001",
"sourceRtspUrl": "rtsp://admin:password@192.168.1.101:554/stream1",
"profile": "low_latency",
"whipUrl": "https://customer-xxx.cloudflarestream.com/xxx/webRTC/publish",
"playbackUrl": "https://customer-xxx.cloudflarestream.com/xxx/webRTC/play",
"status": "STREAMING",
"statusDescription": "推流中",
"errorMessage": "string",
"retryCount": 0,
"remark": "string",
"createdAt": "2024-01-15T10:30:00",
"startedAt": "2024-01-15T10:30:05",
"stoppedAt": "yyyy-MM-dd HH:mm:ss"
}
]
}
无
维护人:TG Live
GET http://localhost:10050/api/stream/tasks/activeGET https://tg-live-game.pwtk.cc/api/stream/tasks/active描述:获取所有活动任务
ContentType:application/x-www-form-urlencoded;charset=UTF-8
| 名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
|---|---|---|---|---|---|
| success | Boolean | 否 | - | 请求是否成功 | true |
| errCode | String | 否 | - | 错误码(失败时返回) | |
| errMessage | String | 否 | - | 错误信息(失败时返回) | |
| data | array | 否 | 响应数据 (ActualType: List) | ||
| └ streamSn | String | 否 | - | 推流任务流水号 | stream_abc123def456 |
| └ name | String | 否 | - | 任务名称 | 投币机 1 号直播 |
| └ lssId | String | 否 | - | LSS 节点 ID | lss_001 |
| └ cameraId | String | 否 | - | 摄像头 ID | cam_001 |
| └ sourceRtspUrl | String | 否 | - | 源 RTSP 地址 | rtsp://admin:password@192.168.1.101:554/stream1 |
| └ profile | String | 否 | - | 推流配置档位: low_latency / standard / file_loop | low_latency |
| └ whipUrl | String | 否 | - | WHIP 推流地址 | https://customer-xxx.cloudflarestream.com/xxx/webRTC/publish |
| └ playbackUrl | String | 否 | - | WebRTC 播放地址 | https://customer-xxx.cloudflarestream.com/xxx/webRTC/play |
| └ status | String | 否 | - | 推流状态: IDLE, STARTING, STREAMING, STOPPED, ERROR | STREAMING |
| └ statusDescription | String | 否 | - | 状态描述 | 推流中 |
| └ errorMessage | String | 否 | - | 错误信息 | |
| └ retryCount | int | 否 | - | 重试次数 | 0 |
| └ remark | String | 否 | - | 备注 | |
| └ createdAt | LocalDateTime | 否 | - | 创建时间 | 2024-01-15T10:30:00 |
| └ startedAt | LocalDateTime | 否 | - | 开始推流时间 | 2024-01-15T10:30:05 |
| └ stoppedAt | LocalDateTime | 否 | - | 停止推流时间 | yyyy-MM-dd HH:mm:ss |
{
"success": true,
"errCode": "string",
"errMessage": "string",
"data": [
{
"streamSn": "stream_abc123def456",
"name": "投币机1号直播",
"lssId": "lss_001",
"cameraId": "cam_001",
"sourceRtspUrl": "rtsp://admin:password@192.168.1.101:554/stream1",
"profile": "low_latency",
"whipUrl": "https://customer-xxx.cloudflarestream.com/xxx/webRTC/publish",
"playbackUrl": "https://customer-xxx.cloudflarestream.com/xxx/webRTC/play",
"status": "STREAMING",
"statusDescription": "推流中",
"errorMessage": "string",
"retryCount": 0,
"remark": "string",
"createdAt": "2024-01-15T10:30:00",
"startedAt": "2024-01-15T10:30:05",
"stoppedAt": "yyyy-MM-dd HH:mm:ss"
}
]
}
无
维护人:TG Live
GET http://localhost:10050/api/stream/channelsGET https://tg-live-game.pwtk.cc/api/stream/channels描述:获取推流通道列表
ContentType:application/x-www-form-urlencoded;charset=UTF-8
| 名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
|---|---|---|---|---|---|
| success | Boolean | 否 | - | 请求是否成功 | true |
| errCode | String | 否 | - | 错误码(失败时返回) | |
| errMessage | String | 否 | - | 错误信息(失败时返回) | |
| data | array | 否 | 响应数据 (ActualType: List) | ||
| └ channelId | String | 否 | - | 通道 ID | cf_channel_001 |
| └ name | String | 否 | - | 通道名称 | 主推流通道 |
| └ mode | String | 否 | - | 推流模式: WHIP, RTMPS | WHIP |
| └ hlsPlaybackUrl | String | 否 | - | HLS 播放地址 | https://customer-xxx.cloudflarestream.com/xxx/manifest/video.m3u8 |
| └ recordingEnabled | boolean | 否 | - | 是否启用录制 | false |
{
"success": true,
"errCode": "string",
"errMessage": "string",
"data": [
{
"channelId": "cf_channel_001",
"name": "主推流通道",
"mode": "WHIP",
"hlsPlaybackUrl": "https://customer-xxx.cloudflarestream.com/xxx/manifest/video.m3u8",
"recordingEnabled": false
}
]
}
无
维护人:TG Live
GET http://localhost:10050/api/stream/playback/{streamSn}GET https://tg-live-game.pwtk.cc/api/stream/playback/{streamSn}描述:获取播放信息
ContentType:application/x-www-form-urlencoded;charset=UTF-8
| 名称 | 必填 | 描述 | 示例值 |
|---|---|---|---|
| streamSn | 是 | 推流任务流水号 | stream_abc123def456 |
| 名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
|---|---|---|---|---|---|
| success | Boolean | 否 | - | 请求是否成功 | true |
| errCode | String | 否 | - | 错误码(失败时返回) | |
| errMessage | String | 否 | - | 错误信息(失败时返回) | |
| data | object | 否 | 响应数据 (ActualType: PlaybackInfoDTO) | ||
| └ streamSn | String | 否 | - | 推流任务流水号 | stream_abc123def456 |
| └ name | String | 否 | - | 任务名称 | 投币机 1 号直播 |
| └ status | String | 否 | - | 推流状态 | STREAMING |
| └ whepUrl | String | 否 | - | WHEP 播放地址(WebRTC 低延迟) | https://customer-pj89kn2ke2tcuh19.cloudflarestream.com/xxx/webRTC/play |
| └ hlsUrl | String | 否 | - | HLS 播放地址 | https://customer-pj89kn2ke2tcuh19.cloudflarestream.com/xxx/manifest/video.m3u8 |
| └ iframeCode | String | 否 | - | iframe 嵌入代码 | |
| └ isLive | Boolean | 否 | - | 是否正在推流 | true |
{
"success": true,
"errCode": "string",
"errMessage": "string",
"data": {
"streamSn": "stream_abc123def456",
"name": "投币机1号直播",
"status": "STREAMING",
"whepUrl": "https://customer-pj89kn2ke2tcuh19.cloudflarestream.com/xxx/webRTC/play",
"hlsUrl": "https://customer-pj89kn2ke2tcuh19.cloudflarestream.com/xxx/manifest/video.m3u8",
"iframeCode": "<iframe src=... allow=accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture; allowfullscreen=true></iframe>",
"isLive": true
}
}
无
维护人:TG Live
POST http://localhost:10050/api/stream/switchPOST https://tg-live-game.pwtk.cc/api/stream/switch描述:切换推流源
ContentType:application/json
| 名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
|---|---|---|---|---|---|
| streamSn | String | 是 | - | 推流任务流水号 | stream_abc123def456 |
| newCameraId | String | 是 | - | 新的摄像头 ID | cam_001 |
| newRtspUrl | String | 是 | - | 新的 RTSP 地址 | rtsp://admin:password@192.168.1.101:554/stream1 |
{
"streamSn": "stream_abc123def456",
"newCameraId": "cam_001",
"newRtspUrl": "rtsp://admin:password@192.168.1.101:554/stream1"
}
| 名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
|---|---|---|---|---|---|
| success | Boolean | 否 | - | 请求是否成功 | true |
| errCode | String | 否 | - | 错误码(失败时返回) | |
| errMessage | String | 否 | - | 错误信息(失败时返回) | |
| data | object | 否 | 响应数据 (ActualType: StreamTaskDTO) | ||
| └ streamSn | String | 否 | - | 推流任务流水号 | stream_abc123def456 |
| └ name | String | 否 | - | 任务名称 | 投币机 1 号直播 |
| └ lssId | String | 否 | - | LSS 节点 ID | lss_001 |
| └ cameraId | String | 否 | - | 摄像头 ID | cam_001 |
| └ sourceRtspUrl | String | 否 | - | 源 RTSP 地址 | rtsp://admin:password@192.168.1.101:554/stream1 |
| └ profile | String | 否 | - | 推流配置档位: low_latency / standard / file_loop | low_latency |
| └ whipUrl | String | 否 | - | WHIP 推流地址 | https://customer-xxx.cloudflarestream.com/xxx/webRTC/publish |
| └ playbackUrl | String | 否 | - | WebRTC 播放地址 | https://customer-xxx.cloudflarestream.com/xxx/webRTC/play |
| └ status | String | 否 | - | 推流状态: IDLE, STARTING, STREAMING, STOPPED, ERROR | STREAMING |
| └ statusDescription | String | 否 | - | 状态描述 | 推流中 |
| └ errorMessage | String | 否 | - | 错误信息 | |
| └ retryCount | int | 否 | - | 重试次数 | 0 |
| └ remark | String | 否 | - | 备注 | |
| └ createdAt | LocalDateTime | 否 | - | 创建时间 | 2024-01-15T10:30:00 |
| └ startedAt | LocalDateTime | 否 | - | 开始推流时间 | 2024-01-15T10:30:05 |
| └ stoppedAt | LocalDateTime | 否 | - | 停止推流时间 | yyyy-MM-dd HH:mm:ss |
{
"success": true,
"errCode": "string",
"errMessage": "string",
"data": {
"streamSn": "stream_abc123def456",
"name": "投币机1号直播",
"lssId": "lss_001",
"cameraId": "cam_001",
"sourceRtspUrl": "rtsp://admin:password@192.168.1.101:554/stream1",
"profile": "low_latency",
"whipUrl": "https://customer-xxx.cloudflarestream.com/xxx/webRTC/publish",
"playbackUrl": "https://customer-xxx.cloudflarestream.com/xxx/webRTC/play",
"status": "STREAMING",
"statusDescription": "推流中",
"errorMessage": "string",
"retryCount": 0,
"remark": "string",
"createdAt": "2024-01-15T10:30:00",
"startedAt": "2024-01-15T10:30:05",
"stoppedAt": "yyyy-MM-dd HH:mm:ss"
}
}
无