rtcManage#
rtcManage#
RTC management
- rtcManage
- .initRTCEngine(params) ⇒
null - .destroy() ⇒
null - .sendRTCMessage(msg) ⇒
number - .joinRoom(params) ⇒
null - .leaveRoom() ⇒
null - .publish(type, hasVideo, hasAudio) ⇒
null - .unPublish() ⇒
null - .subscribe(sources) ⇒
null - .unSubscribe(id) ⇒
null - .muteLocalAudio(mute) ⇒
null - .muteLocalVideo(mute) ⇒
null - .muteRemoteAudio(stream, mute) ⇒
null - .muteRemoteVideo(stream, mute) ⇒
null - .getJanusObject() ⇒
object - .getPublishHandler() ⇒
object - .getSubscribeHandler() ⇒
object
rtcManage.initRTCEngine(params) ⇒ null#
Initiate an audio and video call
Kind: static method of rtcManage
| Param | Type | Description |
|---|---|---|
| params | object | initialization parameter |
| params.server | string | RTC server address |
| params.id | number | user id |
| params.caller | boolean | user is caller or not |
| params.receiver | number | receiver id |
| params.pin | string | join room pin code |
| params.hasVideo | boolean | has video stream |
| params.hasAudio | boolean | has audio stream |
| params.attachStream | function | Voice & video call stream handler |
| params.getThrough | function | getThrough process function |
| params.hangupCall | function | hangupCall process function |
| params.getHangUpStatus | function | Hang-up state getter. The following parameters are required when caller is true (callee parameters). |
| params.roomId | number | Room ID that the callee is invited to join. The following parameters are required when caller is true (caller parameters). |
| params.secret | string | create rtc room secret |
| params.callId | string | Required voice & video session parameters when creating a call with a call ID, including the video width and height setters. |
| params.width | number | video width |
| params.height | number | video height |
rtcManage.destroy() ⇒ null#
Destroy function(destroy rtc environment)
Kind: static method of rtcManage
| Type |
|---|
null |
rtcManage.sendRTCMessage(msg) ⇒ number#
Send RTC message
Kind: static method of rtcManage
Returns: number - client generate RTC message id
| Param | Type | Description |
|---|---|---|
| msg | object | message body |
| msg.uid | string | receiver ID |
| msg.content | string | Message content |
| msg.config | string | object | Extension data |
rtcManage.joinRoom(params) ⇒ null#
Join RTC room
Kind: static method of rtcManage
| Param | Type | Description |
|---|---|---|
| params | object | initialization parameters |
rtcManage.leaveRoom() ⇒ null#
Leave RTC room
Kind: static method of rtcManage
| Type |
|---|
null |
rtcManage.publish(type, hasVideo, hasAudio) ⇒ null#
Publish local video/audio streams
Kind: static method of rtcManage
| Param | Type | Description |
|---|---|---|
| type | enum | disable flag |
| hasVideo | boolean | has video stream |
| hasAudio | boolean | has audio stream |
rtcManage.unPublish() ⇒ null#
Unpublish operation
Kind: static method of rtcManage
| Type |
|---|
null |
rtcManage.subscribe(sources) ⇒ null#
Subscribe remote video/audio streams
Kind: static method of rtcManage
| Param | Type |
|---|---|
| sources | Array |
rtcManage.unSubscribe(id) ⇒ null#
UnSubscribe stream operation
Kind: static method of rtcManage
| Param | Type | Description |
|---|---|---|
| id | number | unSubscribe stream id |
rtcManage.muteLocalAudio(mute) ⇒ null#
Mute local audio or not
Kind: static method of rtcManage
| Param | Type | Description |
|---|---|---|
| mute | boolean | mute flag |
rtcManage.muteLocalVideo(mute) ⇒ null#
Mute local video or not
Kind: static method of rtcManage
| Param | Type | Description |
|---|---|---|
| mute | boolean | mute flag |
rtcManage.muteRemoteAudio(stream, mute) ⇒ null#
Mute remote audio or not
Kind: static method of rtcManage
| Param | Type | Description |
|---|---|---|
| stream | object | mute stream id |
| mute | boolean | mute flag |
rtcManage.muteRemoteVideo(stream, mute) ⇒ null#
Mute remote video or not
Kind: static method of rtcManage
| Param | Type | Description |
|---|---|---|
| stream | object | mute stream id |
| mute | boolean | mute flag |
rtcManage.getJanusObject() ⇒ object#
Get janus object handler
Kind: static method of rtcManage
| Type |
|---|
null |
rtcManage.getPublishHandler() ⇒ object#
Get publisher object handler
Kind: static method of rtcManage
| Type |
|---|
null |
rtcManage.getSubscribeHandler() ⇒ object#
Get subscriber object handler
Kind: static method of rtcManage
| Type |
|---|
null |