> For the complete documentation index, see [llms.txt](https://polyv.gitbook.io/document/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://polyv.gitbook.io/document/docs/live/java/channelstate.md).

# Channel State

### 1、查询频道实时推流信息

#### 描述

```
查询频道实时推流信息
接口地址（仅做说明使用）：https://api.polyv.net/live/v3/channel/monitor/get-stream-info
```

#### 调用约束

1、接口调用有频率限制，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/limit.md)，调用常见异常，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/exceptionDoc/README.md)

2、讲师未进入直播间或未开启上课等情况，将抛出"channel status not live"异常

#### 单元测试

```java
	@Test
	public void testGetChannelStreamInfo() throws Exception, NoSuchAlgorithmException {
        LiveChannelStreamInfoRequest liveChannelStreamInfoRequest = new LiveChannelStreamInfoRequest();
        LiveChannelStreamInfoResponse liveChannelStreamInfoResponse;
        try {
            liveChannelStreamInfoRequest.setChannelId(createChannel());
            liveChannelStreamInfoResponse = new LiveChannelStateServiceImpl().getChannelStreamInfo(
                    liveChannelStreamInfoRequest);
            Assert.assertNotNull(liveChannelStreamInfoResponse);
            if (liveChannelStreamInfoResponse != null) {
                //to do something ......
                log.debug("批量查询频道直播流状态成功{}", JSON.toJSONString(liveChannelStreamInfoResponse));
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误，错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑，记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }
```

#### 单元测试说明

1、请求正确，返回LiveChannelStreamInfoResponse对象，B端依据此对象处理业务逻辑；

2、请求参数校验不合格，抛出PloyvSdkException，错误信息见PloyvSdkException.getMessage()，如 \[ 输入参数 \[xxx.chat.LivexxxRequest]对象校验失败，失败字段 \[pic不能为空 / msg不能为空] ]

3、服务器处理异常，抛出PloyvSdkException，错误信息见PloyvSdkException.getMessage()，如 \[ 保利威请求返回数据错误，请求流水号：66e7ad29fd04425a84c2b2b562d2025b，错误原因： invalid signature. ]

#### 请求入参描述

| 参数名       | 必选   | 类型     | 说明  |
| --------- | ---- | ------ | --- |
| channelId | true | String | 频道号 |

#### 返回对象描述

| 参数名           | 类型     | 说明                  |
| ------------- | ------ | ------------------- |
| deployAddress | String | 推送的CDN节点IP，可能会为null |
| inAddress     | String | 推流出口ip，可能会为null     |
| streamName    | String | 流名                  |
| fps           | String | 推流帧率                |
| lfr           | String | 推流丢帧率，可能会为null      |
| inBandWidth   | String | 推流码率                |

\ <br>

***

\ <br>

### 2、批量查询频道直播流状态

#### 描述

```
批量查询频道直播流状态
接口地址（仅做说明使用）：https://api.polyv.net/live/v2/channels/live-status
```

#### 调用约束

1、接口调用有频率限制，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/limit.md)，调用常见异常，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/exceptionDoc/README.md)

#### 单元测试

```java
	@Test
	public void testListChannelLiveStream() throws Exception, NoSuchAlgorithmException {
        LiveListChannelStreamStatusRequest liveListChannelStreamStatusRequest =
                new LiveListChannelStreamStatusRequest();
        LiveListChannelStreamStatusResponse liveListChannelStreamStatusResponse;
        try {
            //准备测试数据
            String channelId0 = super.createChannel();
            String channelId1 = getAloneChannelId();
            liveListChannelStreamStatusRequest.setChannelIds(String.format("%s,%s", channelId0, channelId1));
            liveListChannelStreamStatusResponse = new LiveChannelStateServiceImpl().listChannelLiveStream(
                    liveListChannelStreamStatusRequest);
            Assert.assertNotNull(liveListChannelStreamStatusResponse);
            if (liveListChannelStreamStatusResponse != null) {
                //to do something ......
                log.debug("批量查询频道直播流状态成功{}", JSON.toJSONString(liveListChannelStreamStatusResponse));
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误，错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑，记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }
```

#### 单元测试说明

1、请求正确，返回LiveListChannelStreamStatusResponse对象，B端依据此对象处理业务逻辑；

2、请求参数校验不合格，抛出PloyvSdkException，错误信息见PloyvSdkException.getMessage()，如 \[ 输入参数 \[xxx.chat.LivexxxRequest]对象校验失败，失败字段 \[pic不能为空 / msg不能为空] ]

3、服务器处理异常，抛出PloyvSdkException，错误信息见PloyvSdkException.getMessage()，如 \[ 保利威请求返回数据错误，请求流水号：66e7ad29fd04425a84c2b2b562d2025b，错误原因： invalid signature. ]

#### 请求入参描述

| 参数名        | 必选   | 类型     | 说明                             |
| ---------- | ---- | ------ | ------------------------------ |
| channelIds | true | String | 用逗号隔开的频道号，如：10000,100001 最多20个 |

#### 返回对象描述

| 参数名         | 类型    | 说明                                                                                                                                                                            |
| ----------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| channelInfo | Array | 频道信息【详见[LiveChannelStreamStatusResponse参数描述](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/channelState.md?id=paf7428378da0dc7f5dac2442454c3cf4)】 |

[**LiveChannelStreamStatusResponse参数描述**](#/channelState.md?id=paf7428378da0dc7f5dac2442454c3cf4)

| 参数名       | 类型     | 说明                       |
| --------- | ------ | ------------------------ |
| channelId | String | 频道号                      |
| status    | String | 频道的直播状态，字符串，值包括：live end |

\ <br>

***

\ <br>

### 3、禁止直播频道推流

#### 描述

```
禁止直播频道推流
接口地址（仅做说明使用）：https://api.polyv.net/live/v2/stream/%s/cutoff
```

#### 调用约束

1、接口调用有频率限制，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/limit.md)，调用常见异常，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/exceptionDoc/README.md)

#### 单元测试

```java
	@Test
	public void testCutoffChannelStream() throws Exception, NoSuchAlgorithmException {
        LiveCutoffChannelStreamRequest liveCutoffChannelStreamRequest = new LiveCutoffChannelStreamRequest();
        Boolean liveCutoffChannelStreamResponse;
        try {
            //准备测试数据
            String channelId = super.createChannel();
            liveCutoffChannelStreamRequest.setChannelId(channelId);
            liveCutoffChannelStreamResponse = new LiveChannelStateServiceImpl().cutoffChannelStream(
                    liveCutoffChannelStreamRequest);
            Assert.assertNotNull(liveCutoffChannelStreamResponse);
            if (liveCutoffChannelStreamResponse) {
                //to do something ......
                log.debug("禁止直播频道推流成功");
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误，错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑，记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }
```

#### 单元测试说明

1、请求正确，返回Boolean对象，B端依据此对象处理业务逻辑；

2、请求参数校验不合格，抛出PloyvSdkException，错误信息见PloyvSdkException.getMessage()，如 \[ 输入参数 \[xxx.chat.LivexxxRequest]对象校验失败，失败字段 \[pic不能为空 / msg不能为空] ]

3、服务器处理异常，抛出PloyvSdkException，错误信息见PloyvSdkException.getMessage()，如 \[ 保利威请求返回数据错误，请求流水号：66e7ad29fd04425a84c2b2b562d2025b，错误原因： invalid signature. ]

#### 请求入参描述

| 参数名        | 必选    | 类型     | 说明                        |
| ---------- | ----- | ------ | ------------------------- |
| channelId  | true  | String | 频道号                       |
| forbidTime | false | Date   | 禁播截至日期，最长禁播90天，不传默认禁播24小时 |

#### 返回对象描述

true为禁止推流成功，false为失败\ <br>

***

\ <br>

### 4、恢复直播频道推流

#### 描述

```
恢复直播频道推流
接口地址（仅做说明使用）：https://api.polyv.net/live/v2/stream/%s/resume
```

#### 调用约束

1、接口调用有频率限制，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/limit.md)，调用常见异常，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/exceptionDoc/README.md)

#### 单元测试

```java
	@Test
	public void testResumeChannelStream() throws Exception, NoSuchAlgorithmException {
        LiveResumeChannelStreamRequest liveResumeChannelStreamRequest = new LiveResumeChannelStreamRequest();
        Boolean liveResumeChannelStreamResponse;
        try {
            //准备测试数据
            String channelId = super.createChannel();
            liveResumeChannelStreamRequest.setChannelId(channelId);
            liveResumeChannelStreamResponse = new LiveChannelStateServiceImpl().resumeChannelStream(
                    liveResumeChannelStreamRequest);
            Assert.assertNotNull(liveResumeChannelStreamResponse);
            if (liveResumeChannelStreamResponse) {
                //to do something ......
                log.debug("恢复直播频道推流成功");
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误，错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑，记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }
```

#### 单元测试说明

1、请求正确，返回Boolean对象，B端依据此对象处理业务逻辑；

2、请求参数校验不合格，抛出PloyvSdkException，错误信息见PloyvSdkException.getMessage()，如 \[ 输入参数 \[xxx.chat.LivexxxRequest]对象校验失败，失败字段 \[pic不能为空 / msg不能为空] ]

3、服务器处理异常，抛出PloyvSdkException，错误信息见PloyvSdkException.getMessage()，如 \[ 保利威请求返回数据错误，请求流水号：66e7ad29fd04425a84c2b2b562d2025b，错误原因： invalid signature. ]

#### 请求入参描述

| 参数名       | 必选   | 类型     | 说明  |
| --------- | ---- | ------ | --- |
| channelId | true | String | 频道号 |

#### 返回对象描述

true为恢复成功，false为恢复失败\ <br>

***

\ <br>

### 5、设置频道流状态为直播中

#### 描述

```
设置频道流状态为直播中
接口地址（仅做说明使用）：https://api.polyv.net/live/v2/channels/%s/live
```

#### 调用约束

1、接口调用有频率限制，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/limit.md)，调用常见异常，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/exceptionDoc/README.md)

#### 单元测试

```java
	@Test
	public void testSetChannelStreamLive() throws Exception, NoSuchAlgorithmException {
        LiveChannelStreamLiveRequest liveChannelStreamLiveRequest = new LiveChannelStreamLiveRequest();
        Boolean liveChannelStreamLiveResponse;
        try {
            //准备测试数据
            String channelId = super.createChannel();
            liveChannelStreamLiveRequest.setChannelId(channelId);
            liveChannelStreamLiveResponse = new LiveChannelStateServiceImpl().setChannelStreamLive(
                    liveChannelStreamLiveRequest);
            Assert.assertNotNull(liveChannelStreamLiveResponse);
            if (liveChannelStreamLiveResponse) {
                //to do something ......
                log.debug("测试设置频道流状态为直播中成功");
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误，错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑，记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }
```

#### 单元测试说明

1、请求正确，返回Boolean对象，B端依据此对象处理业务逻辑；

2、请求参数校验不合格，抛出PloyvSdkException，错误信息见PloyvSdkException.getMessage()，如 \[ 输入参数 \[xxx.chat.LivexxxRequest]对象校验失败，失败字段 \[pic不能为空 / msg不能为空] ]

3、服务器处理异常，抛出PloyvSdkException，错误信息见PloyvSdkException.getMessage()，如 \[ 保利威请求返回数据错误，请求流水号：66e7ad29fd04425a84c2b2b562d2025b，错误原因： invalid signature. ]

#### 请求入参描述

| 参数名       | 必选   | 类型     | 说明  |
| --------- | ---- | ------ | --- |
| channelId | true | String | 频道号 |

#### 返回对象描述

true为设置成功，false为设置失败\ <br>

***

\ <br>

### 6、设置频道为无直播状态

#### 描述

```
设置频道为无直播状态
接口地址（仅做说明使用）：https://api.polyv.net/live/v2/channels/%s/end
```

#### 调用约束

1、接口调用有频率限制，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/limit.md)，调用常见异常，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/exceptionDoc/README.md)

#### 单元测试

```java
	@Test
	public void testSetChannelStreamEnd() throws Exception, NoSuchAlgorithmException {
        LiveChannelStreamEndRequest liveChannelStreamEndRequest = new LiveChannelStreamEndRequest();
        Boolean liveChannelStreamEndResponse;
        try {
            //准备测试数据
            String channelId = super.createChannel();
            liveChannelStreamEndRequest.setChannelId(channelId);
            liveChannelStreamEndResponse = new LiveChannelStateServiceImpl().setChannelStreamEnd(
                    liveChannelStreamEndRequest);
            Assert.assertNotNull(liveChannelStreamEndResponse);
            if (liveChannelStreamEndResponse) {
                //to do something ......
                log.debug("测试设置频道为无直播状态成功");
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误，错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑，记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }
```

#### 单元测试说明

1、请求正确，返回Boolean对象，B端依据此对象处理业务逻辑；

2、请求参数校验不合格，抛出PloyvSdkException，错误信息见PloyvSdkException.getMessage()，如 \[ 输入参数 \[xxx.chat.LivexxxRequest]对象校验失败，失败字段 \[pic不能为空 / msg不能为空] ]

3、服务器处理异常，抛出PloyvSdkException，错误信息见PloyvSdkException.getMessage()，如 \[ 保利威请求返回数据错误，请求流水号：66e7ad29fd04425a84c2b2b562d2025b，错误原因： invalid signature. ]

#### 请求入参描述

| 参数名       | 必选   | 类型     | 说明  |
| --------- | ---- | ------ | --- |
| channelId | true | String | 频道号 |

#### 返回对象描述

true为设置成功，false为设置失败\ <br>

***

\ <br>

### 7、批量查询频道直播状态

#### 描述

```
批量查询频道直播状态
接口地址（仅做说明使用）：https://api.polyv.net/live/v4/channel/live-status/list
```

#### 调用约束

1、接口调用有频率限制，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/limit.md)，调用常见异常，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/exceptionDoc/README.md)

#### 单元测试

```java
	@Test
	public void testGetLiveStatus() throws Exception, NoSuchAlgorithmException {
        LiveListChannelStreamStatusV2Request liveListChannelStreamStatusV2Request = new LiveListChannelStreamStatusV2Request();
        List<LiveListChannelStreamStatusV2Response> liveListChannelStreamStatusV2Respons;
        try {
            //准备测试数据
            String channelIds = String.format("%s,%s", super.getAloneChannelId(), super.createChannel());
            liveListChannelStreamStatusV2Request.setChannelIds(channelIds);
            liveListChannelStreamStatusV2Respons = new LiveChannelStateServiceImpl().listChannelLiveStreamV2(
                    liveListChannelStreamStatusV2Request);
            Assert.assertNotNull(liveListChannelStreamStatusV2Respons);
            if (liveListChannelStreamStatusV2Respons != null) {
                //to do something ......
                log.debug("测试批量查询频道直播状态成功:{}", JSON.toJSONString(liveListChannelStreamStatusV2Respons));
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误，错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑，记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }
```

#### 单元测试说明

1、请求正确，返回LiveListChannelStreamStatusV2Response对象，B端依据此对象处理业务逻辑；

2、请求参数校验不合格，抛出PloyvSdkException，错误信息见PloyvSdkException.getMessage()，如 \[ 输入参数 \[xxx.chat.LivexxxRequest]对象校验失败，失败字段 \[pic不能为空 / msg不能为空] ]

3、服务器处理异常，抛出PloyvSdkException，错误信息见PloyvSdkException.getMessage()，如 \[ 保利威请求返回数据错误，请求流水号：66e7ad29fd04425a84c2b2b562d2025b，错误原因： invalid signature. ]

#### 请求入参描述

| 参数名        | 必选   | 类型     | 说明                               |
| ---------- | ---- | ------ | -------------------------------- |
| channelIds | true | String | 用英文逗号隔开的频道号，如：10000,100001 最多20个 |

#### 返回对象描述

返回对象是List\<LiveListChannelStreamStatusV2Response>，**LiveListChannelStreamStatusV2Response**具体元素内容如下：

| 参数名        | 类型     | 说明                                                         |
| ---------- | ------ | ---------------------------------------------------------- |
| channelId  | String | 频道ID                                                       |
| liveStatus | String | 直播状态 unStart：未开始 live：直播中 end：已结束 waiting：等待中 playback：回放中 |

\ <br>

***

\ <br>

### 8、批量查询频道直播流信息

#### 描述

```
批量获取频道直播的实时推流信息
接口地址（仅做说明使用）：https://api.polyv.net/live/v3/channel/monitor/get-streams
```

#### 调用约束

1、接口调用有频率限制，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/limit.md)，调用常见异常，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/exceptionDoc/README.md)

#### 单元测试

```java
	@Test
	public void testGetStreams() throws IOException, NoSuchAlgorithmException {
        LiveGetStreamsRequest liveGetStreamsRequest = new LiveGetStreamsRequest();
        List<LiveGetStreamsResponse> liveGetStreamsResponse;
        try {
            String channelId = super.createChannel();
            liveGetStreamsRequest.setChannelIds(channelId);
            liveGetStreamsResponse = new LiveChannelStateServiceImpl().getStreams(liveGetStreamsRequest);
            Assert.assertNotNull(liveGetStreamsResponse);
            if (liveGetStreamsResponse != null) {
                //to do something ......
                log.debug("测试批量查询频道直播流信息成功 {}", JSON.toJSONString(liveGetStreamsResponse));
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误，错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑，记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }
```

#### 单元测试说明

1、请求正确，返回LiveGetStreamsResponse对象，B端依据此对象处理业务逻辑；

2、请求参数校验不合格，抛出PloyvSdkException，错误信息见PloyvSdkException.getMessage()，如 \[ 输入参数 \[xxx.chat.LivexxxRequest]对象校验失败，失败字段 \[pic不能为空 / msg不能为空] ]

3、服务器处理异常，抛出PloyvSdkException，错误信息见PloyvSdkException.getMessage()，如 \[ 保利威请求返回数据错误，请求流水号：66e7ad29fd04425a84c2b2b562d2025b，错误原因： invalid signature. ]

#### 请求入参描述

| 参数名        | 必选   | 类型     | 说明                         |
| ---------- | ---- | ------ | -------------------------- |
| channelIds | true | String | 直播中的频道号，多个频道用英文逗号分隔，最多100个 |

#### 返回对象描述

返回对象是List\<LiveGetStreamsResponse>，**LiveGetStreamsResponse**具体元素内容如下：

| 参数名        | 类型      | 说明                                                                                                                                                                          |
| ---------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| channelId  | String  | 频道号                                                                                                                                                                         |
| live       | Boolean | 频道是否直播中 true：直播中 false：未直播                                                                                                                                                  |
| streamInfo | Array   | 频道推流信息，直播中才有值，未直播时为null【详见[StreamInfo参数描述](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/channelState.md?id=p237ef4218dbb9f483997f9f92be087d9)】 |

[**StreamInfo参数描述**](#/channelState.md?id=p237ef4218dbb9f483997f9f92be087d9)

| 参数名           | 类型     | 说明           |
| ------------- | ------ | ------------ |
| deployAddress | String | 推送的CDN节点IP地址 |
| inAddress     | String | 推流出口IP地址     |
| streamName    | String | 流名           |
| fps           | String | 推流帧率         |
| lfr           | String | 推流丢帧率        |
| inBandWidth   | String | 推流码率，单位：bps  |

\ <br>

***

\ <br>

### 9、结束伪直播

#### 描述

```
结束当前正在直播中的伪直播
接口地址（仅做说明使用）：https://api.polyv.net/live/v3/channel/stream/end-disk-push
```

#### 调用约束

1、接口调用有频率限制，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/limit.md)，调用常见异常，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/exceptionDoc/README.md)

#### 单元测试

```java
	@Test
	public void testEndDiskPush() throws IOException, NoSuchAlgorithmException {
        LiveEndDiskPushRequest liveEndDiskPushRequest = new LiveEndDiskPushRequest();
        Boolean liveEndDiskPushResponse;
        try {
            String channelId = super.createChannel();
            liveEndDiskPushRequest.setChannelId(channelId);
            liveEndDiskPushResponse = new LiveChannelStateServiceImpl().endDiskPush(liveEndDiskPushRequest);
            Assert.assertNotNull(liveEndDiskPushResponse);
            if (liveEndDiskPushResponse != null) {
                //to do something ......
                log.debug("测试结束伪直播成功 {}", JSON.toJSONString(liveEndDiskPushResponse));
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误，错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑，记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }
```

#### 单元测试说明

1、请求正确，返回Boolean对象，B端依据此对象处理业务逻辑；

2、请求参数校验不合格，抛出PloyvSdkException，错误信息见PloyvSdkException.getMessage()，如 \[ 输入参数 \[xxx.chat.LivexxxRequest]对象校验失败，失败字段 \[pic不能为空 / msg不能为空] ]

3、服务器处理异常，抛出PloyvSdkException，错误信息见PloyvSdkException.getMessage()，如 \[ 保利威请求返回数据错误，请求流水号：66e7ad29fd04425a84c2b2b562d2025b，错误原因： invalid signature. ]

#### 请求入参描述

| 参数名         | 必选    | 类型     | 说明                     |
| ----------- | ----- | ------ | ---------------------- |
| channelId   | true  | String | 频道号                    |
| diskVideoId | false | String | 伪直播id,不传则结束当前时间直播中的伪直播 |

#### 返回对象描述

结束伪直播返回实体<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://polyv.gitbook.io/document/docs/live/java/channelstate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
