Public 成员函数

 login (userId, password, timeout)
 
 logout ()
 
 on (event, callback, isOnce)
 
 off (event, callback)
 
 joinChannel (channelId, ChannelConfig)
 
 leaveChannel ()
 
 stopChannel ()
 
 publishLocalVideoStream (publish)
 
 publishLocalAudioStream (publish)
 
 enableAudioOutput (enable)
 
 getStatistics ()
 
 subscribeParticipantAudio (uid, subscribe)
 
 enableSpeaker (enable)
 
 setEnvironmentAddress (serverAddress)
 
 startLocalAudioDevice (enable)
 
 getCamera ()
 
 getAllCameras ()
 
 switchCamera (camera)
 
 getCameraMaxZoom ()
 
 setCameraZoom (zoom)
 
 isCameraTorchSupported ()
 
 setCameraTorchOn (enable)
 
 setCameraExposureLevel (level)
 
 enableScreenShare (enable, screenShareParam)
 
 setScreenCaptureProperty (width, height, frameRate)
 
 setLocalCaptureAngle (angle)
 
 setVideoAngle (angle)
 
 setCameraProperty (width, height, frameRate)
 
 enableRecord (enable, recordConfig)
 

静态 Public 成员函数

static createEngine (appKey, EngineConfig)
 
static getVersion ()
 

成员函数说明

◆ createEngine()

static JRTCEngine::createEngine (   appKey,
  EngineConfig 
)
inlinestatic

创建Engine实例

参数
{string}appKey
{Object}EngineConfig
返回

◆ enableAudioOutput()

JRTCEngine::enableAudioOutput (   enable)
inline

启用/禁止频道声音外放

参数
enableboolean类型 是否启用
返回

◆ enableRecord()

JRTCEngine::enableRecord (   enable,
  recordConfig 
)
inline

开启录制

参数
enableboolean
recordConfig录制参数,当 enable 为 true 时,可以更改由 join 时传入的录制参数,不需更改则填 null 详见录制参数
注解
CHANNEL_UPDATE CHANNEL_UPDATE 回调通知 recordState 为1 (可以录制)时后调用该接口

◆ enableScreenShare()

JRTCEngine::enableScreenShare (   enable,
  screenShareParam 
)
inline

开启/关闭屏幕共享

参数
enableboolean类型 开启/关闭
screenShareParam屏幕共享配置
  • width 采集宽度,默认1280
  • height 采集高度,默认720
  • frameRate 采集帧速率,默认10
返回
boolean

◆ enableSpeaker()

JRTCEngine::enableSpeaker (   enable)
inline

开启/关闭扬声器

参数
enableboolean类型 启用/关闭
返回

◆ getAllCameras()

JRTCEngine::getAllCameras ( )
inline

获取摄像头列表

注解
暂不支持
返回
Promise<camera[]> 摄像头列表
  • camera
  • cameraId 摄像头id
  • cameraName 摄像头名字
  • cameraType int类型 摄像头类型

◆ getCamera()

JRTCEngine::getCamera ( )
inline

获取当前的摄像头

返回
Promse<camera> 摄像头
  • camera
    参数 说明
    cameraId 摄像头id
    cameraName 摄像头名字
    cameraType 摄像头类型

◆ getCameraMaxZoom()

JRTCEngine::getCameraMaxZoom ( )
inline

获取摄当前摄像头支持的最大变焦倍数

返回
number

◆ getStatistics()

JRTCEngine::getStatistics ( )
inline

获取统计数据

返回

◆ getVersion()

static JRTCEngine::getVersion ( )
inlinestatic

获取版本信息

返回
Info 版本信息

◆ isCameraTorchSupported()

JRTCEngine::isCameraTorchSupported ( )
inline

查询当前摄像头是否支持闪光灯

返回

◆ joinChannel()

JRTCEngine::joinChannel (   channelId,
  ChannelConfig 
)
inline

加入频道

参数
channelIdstring类型 频道ID
ChannelConfig频道配置
  • publishLocalAudio 是否默认发布本地音频流
  • publishLocalVideo 是否默认发布本地视频流
  • password 密码
  • capacity 频道最大人数,默认值为 16
  • degradationMode int类型 默认MAINTAIN_QUALITY
    • MAINTAIN_QUALITY = 0:(默认)带宽受限时,视频编码时优先降低视频帧率,维持分辨率不变。该降级偏好适用于画质优先的场景。
    • MAINTAIN_FRAMERATE = 1:带宽受限时,视频编码时优先降低视频分辨率,维持视频帧率不变。该降级偏好适用于流畅性优先且允许画质降低的场景。
  • maxResolution
  • heartbeatTime
  • heartbeatTimeout
  • frameRate 帧率 1-30, 默认值为 24
  • videoRatio float类型 频道画面比例,传入值为宽高比浮点数,默认为 16:9
  • recordParam 录制参数 详见录制参数 当携带时 监听CHANNEL_UPDATE 内recordState 获取录制器状态
返回

◆ leaveChannel()

JRTCEngine::leaveChannel ( )
inline

离开当前频道

返回

◆ login()

JRTCEngine::login (   userId,
  password,
  timeout 
)
inline

登入

参数
userIdstring类型 用户名,长度在 64 字节以内的字符串。以下为支持的字符集范围(共 66 个字符):
  • 26 个小写英文字母 a-z
  • 26 个大写英文字母 A-Z
  • 10 个数字 0-9
  • '+','-','_','.'。另外 '-','_','.' 这三个字符不能处于用户名的第一位
    参数
    passwordstring类型 密码,不能为 null 或 "",长度不能超过 128 字符。免鉴权模式密码可以随意输入,Token 鉴权模式密码需要输入外部生成的 Token
    timeoutnumber类型 超时时间 默认60s
    返回

◆ logout()

JRTCEngine::logout ( )
inline

登出 登出后不能进行平台上的各种业务

返回
void

◆ off()

JRTCEngine::off (   event,
  callback 
)
inline

取消事件监听

参数
eventstring类型 事件名 事件枚举见 JRTCEventType
callback回调方法

◆ on()

JRTCEngine::on (   event,
  callback,
  isOnce 
)
inline

添加事件监听

参数
eventstring类型 事件名 事件枚举见 JRTCEventType
callback回调方法 回调参数见 事件说明
isOnce回调成功后是否自动销毁监听
返回

◆ publishLocalAudioStream()

JRTCEngine::publishLocalAudioStream (   publish)
inline

开启/关闭发送本地音频流

参数
{boolean}publish
返回

◆ publishLocalVideoStream()

JRTCEngine::publishLocalVideoStream (   publish)
inline

开启/关闭发送本地视频流

参数
{boolean}publish
返回

◆ setCameraExposureLevel()

JRTCEngine::setCameraExposureLevel (   level)
inline

设置摄像头曝光度

参数
levelnumber类型 曝光等级
返回

◆ setCameraProperty()

JRTCEngine::setCameraProperty (   width,
  height,
  frameRate 
)
inline

设置摄像头采集参数

参数
widthnumber类型 摄像头采集宽度
heightnumber类型 摄像头采集高度
frameRatenumber类型 摄像头采集帧率
返回

◆ setCameraTorchOn()

JRTCEngine::setCameraTorchOn (   enable)
inline

开启/关闭闪光灯

参数
enableboolean类型 启用/关闭
返回

◆ setCameraZoom()

JRTCEngine::setCameraZoom (   zoom)
inline

设置当前摄像头变焦倍数

参数
zoomnumber类型 变焦倍数
返回

◆ setEnvironmentAddress()

JRTCEngine::setEnvironmentAddress (   serverAddress)
inline

设置环境地址

参数
serverAddressstring类型 登录服务器地址,默认地址为 http:cn.router.justalkcloud.com:8080(国内环境)。如果是海外用户需要设置为 http:intl.router.justalkcloud.com:8080(国际环境)
返回

◆ setLocalCaptureAngle()

JRTCEngine::setLocalCaptureAngle (   angle)
inline

设置本地摄像头采集角度

参数
anglenumber类型
返回

◆ setScreenCaptureProperty()

JRTCEngine::setScreenCaptureProperty (   width,
  height,
  frameRate 
)
inline

设置屏幕共享采集参数

参数
widthnumber类型 设置屏幕共享采集宽度
heightnumber类型 设置屏幕共享采集高度
frameRatenumber类型 设置屏幕共享采集帧率
返回

◆ setVideoAngle()

JRTCEngine::setVideoAngle (   angle)
inline

设置视频窗体角度

参数
anglenumber类型 -1自动 0 90 180 270
返回

◆ startLocalAudioDevice()

JRTCEngine::startLocalAudioDevice (   enable)
inline

启用/关闭本地音频采集

参数
enableboolean类型
返回

◆ stopChannel()

JRTCEngine::stopChannel ( )
inline

结束当前频道

返回

◆ subscribeParticipantAudio()

JRTCEngine::subscribeParticipantAudio (   uid,
  subscribe 
)
inline

订阅/取消订阅用户音频

参数
uidstring 类型
subscribestring 类型
返回

◆ switchCamera()

JRTCEngine::switchCamera (   camera)
inline

切换摄像头

参数
cameracamera列表
返回
Promise<boolean>
  • camera
    参数 说明
    cameraId 摄像头id
    cameraName 摄像头名字
    cameraType 摄像头类型

该类的文档由以下文件生成:
  • typedoc/JRTCEngine.js