蓝莺开发者
Web & Mini ProgramiOSAndroidC++Server API

rtcManage#

rtcManage#

音视频管理

rtcManage.initRTCEngine(params) ⇒ null#

发起端发起音视频呼叫

Kind: static method of rtcManage

ParamTypeDescription
paramsobject初始化参数
params.serverstringRTC服务器地址
params.idnumber音视频用户id
params.callerboolean是否为呼叫发起者
params.receivernumber音视频用户对方id
params.pinstring房间加入pin码(caller为true时发起者需要创建新的pin码)
params.hasVideoboolean是否存在视频流
params.hasAudioboolean是否存在音频流
params.attachStreamfunction音视频通话信息流处理函数
params.getThroughfunction音视频通话是否接通
params.hangupCallfunction音视频通话是否挂断
params.getHangUpStatusfunction获取挂断状态函数 以下是caller为 true 的必须参数(被呼叫者必须参数)
params.roomIdnumber被呼叫者邀请加入的 room id 以下是caller为 true 的必须参数(呼叫者必须参数)
params.secretstring创建的房间操作密码
params.callIdstring创建音视频呼叫时音视频 callid 以下时视频会话必须的参数(视频宽度和高度设置函数)
params.widthnumber视频流画面宽度
params.heightnumber视频流画面高度

Example

{% lanying_code_snippet repo="lanying-im-web",class="rtcManage",function="initRTCEngine" %}{% endlanying_code_snippet %}

rtcManage.destroy() ⇒ null#

销毁操作(在关闭音视频界面时使用)

Kind: static method of rtcManage

Type
null

Example

{% lanying_code_snippet repo="lanying-im-web",class="rtcManage",function="destroy" %}{% endlanying_code_snippet %}

rtcManage.sendRTCMessage(msg) ⇒ number#

发送音视频消息

Kind: static method of rtcManage
Returns: number - 客户端生成的消息ID

ParamTypeDescription
msgobject消息体
msg.uidstring接收者ID
msg.contentstring消息内容
msg.configstring | object扩展字段

Example

{% lanying_code_snippet repo="lanying-im-web",class="rtcManage",function="sendRTCMessage" %}{% endlanying_code_snippet %}

rtcManage.joinRoom(params) ⇒ null#

加入房间操作

Kind: static method of rtcManage

ParamTypeDescription
paramsobject初始化参数

Example

{% lanying_code_snippet repo="lanying-im-web",class="rtcManage",function="joinRoom" %}{% endlanying_code_snippet %}

rtcManage.leaveRoom() ⇒ null#

离开加入房间操作

Kind: static method of rtcManage

Type
null

Example

{% lanying_code_snippet repo="lanying-im-web",class="rtcManage",function="leaveRoom" %}{% endlanying_code_snippet %}

rtcManage.publish(type, hasVideo, hasAudio) ⇒ null#

发布本地流操作

Kind: static method of rtcManage

ParamTypeDescription
typeenum禁止标记
hasVideoboolean是否发布视频
hasAudioboolean是否发布音频

Example

{% lanying_code_snippet repo="lanying-im-web",class="rtcManage",function="publish" %}{% endlanying_code_snippet %}

rtcManage.unPublish() ⇒ null#

取消发布流操作

Kind: static method of rtcManage

Type
null

Example

{% lanying_code_snippet repo="lanying-im-web",class="rtcManage",function="publish" %}{% endlanying_code_snippet %}

rtcManage.subscribe(sources) ⇒ null#

订阅流信息操作

Kind: static method of rtcManage

ParamType
sourcesArray

Example

{% lanying_code_snippet repo="lanying-im-web",class="rtcManage",function="subscribe" %}{% endlanying_code_snippet %}

rtcManage.unSubscribe(id) ⇒ null#

取消订阅流操作

Kind: static method of rtcManage

ParamTypeDescription
idnumber取消订阅的流id

Example

{% lanying_code_snippet repo="lanying-im-web",class="rtcManage",function="unSubscribe" %}{% endlanying_code_snippet %}

rtcManage.muteLocalAudio(mute) ⇒ null#

禁止本地发布音频流操作

Kind: static method of rtcManage

ParamTypeDescription
muteboolean禁止标记

Example

{% lanying_code_snippet repo="lanying-im-web",class="rtcManage",function="muteLocalAudio" %}{% endlanying_code_snippet %}

rtcManage.muteLocalVideo(mute) ⇒ null#

禁止本地发布视频流操作

Kind: static method of rtcManage

ParamTypeDescription
muteboolean禁止标记

Example

{% lanying_code_snippet repo="lanying-im-web",class="rtcManage",function="muteLocalVideo" %}{% endlanying_code_snippet %}

rtcManage.muteRemoteAudio(stream, mute) ⇒ null#

禁止远程订阅音频流操作

Kind: static method of rtcManage

ParamTypeDescription
streamobject订阅流对象
muteboolean禁止标记

Example

{% lanying_code_snippet repo="lanying-im-web",class="rtcManage",function="muteRemoteAudio" %}{% endlanying_code_snippet %}

rtcManage.muteRemoteVideo(stream, mute) ⇒ null#

禁止远程订阅视频流操作

Kind: static method of rtcManage

ParamTypeDescription
streamobject订阅流对象
muteboolean禁止标记

Example

{% lanying_code_snippet repo="lanying-im-web",class="rtcManage",function="muteRemoteVideo" %}{% endlanying_code_snippet %}

rtcManage.getJanusObject() ⇒ object#

获取Janus对象句柄

Kind: static method of rtcManage

Type
null

Example

{% lanying_code_snippet repo="lanying-im-web",class="rtcManage",function="getJanusObject" %}{% endlanying_code_snippet %}

rtcManage.getPublishHandler() ⇒ object#

获取发布操作对象句柄

Kind: static method of rtcManage

Type
null

Example

{% lanying_code_snippet repo="lanying-im-web",class="rtcManage",function="getPublishHandler" %}{% endlanying_code_snippet %}

rtcManage.getSubscribeHandler() ⇒ object#

获取订阅操作对象句柄

Kind: static method of rtcManage

Type
null

Example

{% lanying_code_snippet repo="lanying-im-web",class="rtcManage",function="getSubscribeHandler" %}{% endlanying_code_snippet %}
自动生成的 API 内容,仅在必要位置补充精简的 AI 解释。