藍鶯開發者
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 解說。