
# 视频管理
 #### setupRemoteView
```
virtual int setupRemoteView(const char* userId, view_t view)
```
【**功能说明**】
设置远端流渲染视图（新选看接口），该接口不影响收流。
【**请求参数**】
- userId：远端用户的唯一标识。
- view：窗口句柄，view为NULL时，解除窗口绑定并结束选看。
【**返回参数**】
- 0：方法调用成功。
- \> 0：方法调用失败。具体请参见[HRTCErrorCode](https://support.huaweicloud.com/csdk-rtc/rtc_05_0125.html)。
 
 #### updateRemoteRenderMode
```
virtual int updateRemoteRenderMode(const char* userId, HRTCVideoDisplayMode displayMode, HRTCVideoMirrorType mirrorMode)
```
【**功能说明**】
设置远端用户视图渲染模式。
【**请求参数** 】
- userId：远端用户的唯一标识。
- displayMode：视图显示模式。具体请参见[HRTCVideoDisplayMode](https://support.huaweicloud.com/csdk-rtc/rtc_05_0128.html#rtc_05_0128__zh-cn_topic_0277015533_section162591326191818)，默认RTC_VIDEO_DISPLAY_HIDDEN，通过裁剪的方式保持宽高比。
- mirrorMode：镜像模式。具体请参见[HRTCVideoMirrorType](https://support.huaweicloud.com/csdk-rtc/rtc_05_0128.html#rtc_05_0128__zh-cn_topic_0277015533_section6255102815113) 。
 
【**返回参数**】
- 0：方法调用成功。
- \> 0：方法调用失败。具体请参见[HRTCErrorCode](https://support.huaweicloud.com/csdk-rtc/rtc_05_0125.html)。
 
 #### setRemoteVideoStreamType
```
virtual int setRemoteVideoStreamType(const char *userId, HRTCVideoStreamType type)
```
【**功能说明**】
大小流模式，设置指定选看用户的视频流类型。在通过新选看接口发起选看时调用。
【**请求参数**】
- userId：远端用户唯一标识。
- type：视频流类型。指大流、小流，具体请参见[HRTCVideoStreamType](https://support.huaweicloud.com/csdk-rtc/rtc_05_0128.html#rtc_05_0128__zh-cn_topic_0277015533_section1936155416553)。
【**返回参数**】
- 0：方法调用成功。
- \> 0：方法调用失败。具体请参见[HRTCErrorCode](https://support.huaweicloud.com/csdk-rtc/rtc_05_0125.html)。
 
 #### setPriorRemoteVideoStreamType
```
virtual int setPriorRemoteVideoStreamType(HRTCVideoStreamType type)
```
【**功能说明**】
大小流模式，设置所有订阅的远端视频流类型。默认订阅大流，优先使用setRemoteVideoStreamType接口设置的用户流类型。
【**请求参数**】
type：视频流类型。指大流、小流，具体请参见[HRTCVideoStreamType](https://support.huaweicloud.com/csdk-rtc/rtc_05_0128.html#rtc_05_0128__zh-cn_topic_0277015533_section1936155416553)。
【**返回参数**】
- 0：方法调用成功。
- \> 0：方法调用失败。具体请参见[HRTCErrorCode](https://support.huaweicloud.com/csdk-rtc/rtc_05_0125.html)。
 
 #### pullRemoteVideo
```
virtual int pullRemoteVideo(const char* userId, bool pull)
```
【**功能说明**】
开启/关闭接收指定远端用户的视频流。只能加入房间后调用。
【**请求参数**】
- userId: 远端用户的userId，唯一标识。
- pull：true表示开启接收，false表示关闭接收。
【**返回参数**】
- 0：方法调用成功。
- \> 0：方法调用失败。具体请参见[HRTCErrorCode](https://support.huaweicloud.com/csdk-rtc/rtc_05_0125.html)。
 
#### pullAllRemoteVideo
```
virtual int pullAllRemoteVideo(bool mute)
```
【**功能说明**】
开启/关闭接收当前房间所有远端用户的视频流。
【**请求参数**】
mute：true表示关闭接收，false表示开启接收， 默认开启接收。
【**返回参数**】
- 0：方法调用成功。
- \> 0：方法调用失败。具体请参见[HRTCErrorCode](https://support.huaweicloud.com/csdk-rtc/rtc_05_0125.html)。
 
 #### startRemoteStreamView
```
virtual int startRemoteStreamView(const char* userId, view_t view, HRTCStreamType streamType, bool disableAdjustRes)
```
【**功能说明**】
设置远端用户渲染视图，并开启收流（选看）。
【**请求参数** 】
- userId：远端用户的唯一标识。
- view：窗口句柄。
- streamType：视频分辨率，具体请参见[HRTCStreamType](https://support.huaweicloud.com/csdk-rtc/rtc_05_0128.html#rtc_05_0128__zh-cn_topic_0277015533_section15659205745617)。
- disableAdjustRes：禁用分辨率自适应，默认值false，开启分辨率自适应。若关闭，在网络环境较差情况下可能会有卡顿现象。
 
【**返回参数**】
- 0：方法调用成功。
- \> 0：方法调用失败。具体请参见[HRTCErrorCode](https://support.huaweicloud.com/csdk-rtc/rtc_05_0125.html)。
![](https://support.huaweicloud.com/csdk-rtc/public_sys-resources/caution_3.0-zh-cn.png)
该接口为选看的旧接口，通过该接口和updateRemoteRenderMode完成一次完整的选看流程。新的完成选看功能拆分为三个接口：[setupRemoteView]、[pullRemoteVideo]和[setRemoteVideoStreamType]接口，将设置渲染模式、窗口句柄、选看的流类型拆分并增加pullRemoteVideo收流控制接口，以实现更细化的选看流程控制（将窗口绑定和收流控制分开）。您可以根据需要选择调用不同的接口组合以实现视频选看。
 #### stopRemoteStreamView
```
virtual int stopRemoteStreamView(const char* userId)
```
【**功能说明**】
关闭远端用户的渲染视图，并停止收流（停止选看）。
【**请求参数**】
userId：远端用户的唯一标识。
【**返回参数**】
- 0：方法调用成功。
- \> 0：方法调用失败。具体请参见[HRTCErrorCode](https://support.huaweicloud.com/csdk-rtc/rtc_05_0125.html)。
![](https://support.huaweicloud.com/csdk-rtc/public_sys-resources/caution_3.0-zh-cn.png)
新选看建议通过[setupRemoteView]接口设置窗口句柄为空来停止选看。
 #### setRemoteVideoAdjustResolution
```
virtual int setRemoteVideoAdjustResolution(bool enable)
```
【**功能说明**】
设置是否开启远端流分辨率自适应。默认开启自适应。
【**请求参数**】
enable：是否开启自适应。默认开启。
【**返回参数**】
- 0：方法调用成功。
- \> 0：方法调用失败。具体请参见[HRTCErrorCode](https://support.huaweicloud.com/csdk-rtc/rtc_05_0125.html)。
 
