Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
tuicall-engine-webrtc
Advanced tools
tuicall-engine-webrtc 是基于腾讯云 即时通信 IM 和 实时音视频 TRTC 两项付费 PaaS 服务构建出的音视频通信组件,支持双人和多人场景下的音视频通话。
安装依赖地址:
npm i trtc-js-sdk --save
npm i tim-js-sdk --save
npm i tsignaling --save
npm i tuicall-engine-webrtc --save
import { TUICallEngine, TUICallEvent } from "tuicall-engine-webrtc"
let options = {
SDKAppID: 0, // 接入时需要将0替换为您的云通信应用的 SDKAppID
tim: tim // tim 参数适用于业务中已存在 TIM 实例,为保证 TIM 实例唯一性
};
let tuicallEngine = TUICallEngine.createInstance(options);
参数说明:
API | 含义 |
---|---|
createInstance (params) | 初始实例 |
destroyInstance () | 销毁实例 |
on(eventName, callback, context) | 监听事件 |
off(eventName, callback, context) | 取消监听事件 |
login(params) | 登录 |
logout() | 登出 |
call(params) | 邀请通话 |
groupCall(params) | 邀请群通话 |
accept(params) | 接受通话邀请 |
reject(params) | 拒绝通话邀请 |
hangup() | 挂断 |
startRemoteView(params) | 启动远端画面渲染 |
stopRemoteView(params) | 停止远端画面渲染 |
startLocalView(params) | 启动本地画面渲染 |
stopLocalView(params) | 停止本地画面渲染 |
openCamera() | 启动摄像头 |
closeCamera() | 关闭摄像头 |
openMicrophone | 设备麦克风是否静音 |
closeMicrophone | 设备麦克风是否静音 |
setVideoQuality(profile) | 设置视频质量 |
switchCallMediaType(newMediaType) | 当前通话类型切换 |
getDeviceList(deviceType) | 获取设备列表 |
switchDevice() | 切换摄像头或麦克风设备 |
event | 含义 |
---|---|
TUICallEvent.INVITED, | 收到邀请通知 |
TUICallEvent.REJECT, | 被邀用户拒绝通话 |
TUICallEvent.NO_RESP, | 被邀用户超时无应答 |
TUICallEvent.LINE_BUSY, | 被邀用户正在通话中,忙线 |
TUICallEvent.CALLING_CANCEL, | 本次通话被取消了 |
TUICallEvent.CALLING_TIMEOUT, | 本次通话超时未应答 |
TUICallEvent.CALLING_END, | 本次通话结束 |
TUICallEvent.USER_ENTER, | 用户进入通话 |
TUICallEvent.USER_LEAVE, | 用户离开通话 |
TUICallEvent.KICKED_OUT, | 重复登录,被踢出 |
TUICallEvent.USER_VIDEO_AVAILABLE, | 远端用户开启/关闭了摄像头 |
TUICallEvent.USER_AUDIO_AVAILABLE, | 远端用户开启/关闭了麦克风 |
TUICallEvent.SDK_READY, | SDK 进入 ready 状态 |
TUICallEvent.SDK_NOT_READY, | SDK 没有 ready 状态 |
TUICallEvent.GROUP_CALL_INVITEE_LIST_UPDATE | 群聊更新邀请列表 |
TUICallEvent.CALL_TYPE_CHANGED | 通话类型切换 |
TUICallEvent.DEVICED_UPDATED | 设备列表更新 |
code | 错误类型 | 含义 |
---|---|---|
60001 | 方法调用失败 | switchToAudioCall 调用失败 |
60002 | 方法调用失败 | switchToVideoCall 调用失败 |
60003 | 权限获取失败 | 没有可用的麦克风设备 |
60004 | 权限获取失败 | 没有可用的摄像头设备 |
60005 | 权限获取失败 | 用户禁止使用设备 |
60006 | 环境检测失败 | 当前环境不支持webRTC |
FAQs
腾讯云 TRTC TUICallEngine
The npm package tuicall-engine-webrtc receives a total of 180 weekly downloads. As such, tuicall-engine-webrtc popularity was classified as not popular.
We found that tuicall-engine-webrtc demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.