更新时间:2024-01-15 GMT+08:00
分享

视频管理

setupRemoteView

virtual int setupRemoteView(const char* userId, view_t view)

功能说明

设置远端流渲染视图(新选看接口),该接口不影响收流。

请求参数

  • userId:远端用户的唯一标识。
  • view:窗口句柄,view为NULL时,解除窗口绑定并结束选看。

返回参数

  • 0:方法调用成功。
  • > 0:方法调用失败。具体请参见HRTCErrorCode

updateRemoteRenderMode

virtual int updateRemoteRenderMode(const char* userId, HRTCVideoDisplayMode displayMode, HRTCVideoMirrorType mirrorMode) 

功能说明

设置远端用户视图渲染模式。

请求参数
  • userId:远端用户的唯一标识。
  • displayMode:视图显示模式。具体请参见HRTCVideoDisplayMode,默认RTC_VIDEO_DISPLAY_HIDDEN,通过裁剪的方式保持宽高比。
  • mirrorMode:镜像模式。具体请参见HRTCVideoMirrorType

返回参数

  • 0:方法调用成功。
  • > 0:方法调用失败。具体请参见HRTCErrorCode

setRemoteVideoStreamType

virtual int setRemoteVideoStreamType(const char *userId, HRTCVideoStreamType type)

功能说明

大小流模式,设置指定选看用户的视频流类型。在通过新选看接口发起选看时调用。

请求参数

  • userId:远端用户唯一标识。
  • type:视频流类型。指大流、小流,具体请参见HRTCVideoStreamType

返回参数

  • 0:方法调用成功。
  • > 0:方法调用失败。具体请参见HRTCErrorCode

setPriorRemoteVideoStreamType

virtual int setPriorRemoteVideoStreamType(HRTCVideoStreamType type)

功能说明

大小流模式,设置所有订阅的远端视频流类型。默认订阅大流,优先使用setRemoteVideoStreamType接口设置的用户流类型。

请求参数

type:视频流类型。指大流、小流,具体请参见HRTCVideoStreamType

返回参数

  • 0:方法调用成功。
  • > 0:方法调用失败。具体请参见HRTCErrorCode

pullRemoteVideo

virtual int pullRemoteVideo(const char* userId, bool pull)

功能说明

开启/关闭接收指定远端用户的视频流。只能加入房间后调用。

请求参数

  • userId: 远端用户的userId,唯一标识。
  • pull:true表示开启接收,false表示关闭接收。

返回参数

  • 0:方法调用成功。
  • > 0:方法调用失败。具体请参见HRTCErrorCode

pullAllRemoteVideo

virtual int pullAllRemoteVideo(bool mute)

功能说明

开启/关闭接收当前房间所有远端用户的视频流。

请求参数

mute:true表示关闭接收,false表示开启接收, 默认开启接收。

返回参数

  • 0:方法调用成功。
  • > 0:方法调用失败。具体请参见HRTCErrorCode

startRemoteStreamView

virtual int startRemoteStreamView(const char* userId, view_t view, HRTCStreamType streamType, bool disableAdjustRes)

功能说明

设置远端用户渲染视图,并开启收流(选看)。

请求参数
  • userId:远端用户的唯一标识。
  • view:窗口句柄。
  • streamType:视频分辨率,具体请参见HRTCStreamType
  • disableAdjustRes:禁用分辨率自适应,默认值false,开启分辨率自适应。若关闭,在网络环境较差情况下可能会有卡顿现象。

返回参数

  • 0:方法调用成功。
  • > 0:方法调用失败。具体请参见HRTCErrorCode

该接口为选看的旧接口,通过该接口和updateRemoteRenderMode完成一次完整的选看流程。新的完成选看功能拆分为三个接口:setupRemoteViewpullRemoteVideosetRemoteVideoStreamType接口,将设置渲染模式、窗口句柄、选看的流类型拆分并增加pullRemoteVideo收流控制接口,以实现更细化的选看流程控制(将窗口绑定和收流控制分开)。您可以根据需要选择调用不同的接口组合以实现视频选看。

stopRemoteStreamView

virtual int stopRemoteStreamView(const char* userId)

功能说明

关闭远端用户的渲染视图,并停止收流(停止选看)。

请求参数

userId:远端用户的唯一标识。

返回参数

  • 0:方法调用成功。
  • > 0:方法调用失败。具体请参见HRTCErrorCode

新选看建议通过setupRemoteView接口设置窗口句柄为空来停止选看。

setRemoteVideoAdjustResolution

virtual int setRemoteVideoAdjustResolution(bool enable)

功能说明

设置是否开启远端流分辨率自适应。默认开启自适应。

请求参数

enable:是否开启自适应。默认开启。

返回参数

  • 0:方法调用成功。
  • > 0:方法调用失败。具体请参见HRTCErrorCode
分享:

    相关文档

    相关产品