
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
@dingrtc/rtm
Advanced tools
阿里云音视频通信dingRtc,提供基于WebRTC适用于浏览器的SDK。
You can install it as dependency with npm/cnpm or yarn.
$ # save into package.json dependencies with -S
$ npm install dingrtc -S
$ # you can use cnpm for fast install
$ cnpm install dingrtc -S
$ # use yarn for install
$ yarn add dingrtc
阿里云RTC提供移动端、PC等多端SDK,并兼容标准WebRTC浏览器接入网络,帮助您快速搭建多端实时应用。接入RTC的方法,请参见接口文档。
当您成功搭建本地SDK,可以在终端调用API与RTC服务端进行交互,在加入频道或房间后,您可以进行本地推流、订阅远端用户等操作,实现频道内不同用户之间的音视频实时通话。
阿里云RTC拥有全球实时智能调度系统,并结合实时媒体处理系统和1500+边缘节点,运用行业领先的音频3A(AGC、AEC、ANS)、视频编码、弱网对抗等算法为您提供低延时、抗丢包的音视频实时通信。

import DingRTC from 'dingrtc'
/**
* 创建客户端实例
*/
const client = DingRTC.createClient();
const supported = DingRTC.checkSystemRequirements();
if (supported) {
//支持webrtc
} else {
//不支持webrtc
}
client.on('user-published',(user, mediaType) =>{
//远程发布者userId
console.log(user.userId);
//远程发布轨道类型
console.log(mediaType);
});
client.join({
uid, // 用户ID,只能由数字、字母、下划线组成
channel, // 频道名
appId, // 应用ID
token, // 令牌
userName, // 用户名
}).then((response)=>{
// 入会成功
console.log(response.remoteUsers); // 打印已在会中成员
}).catch((error)=>{
// 入会失败,打印错误内容,可以看到失败原因
console.log(error.message);
});
const cameraTrack = await DingRTC.createCameraVideoTrack({
frameRate: 15,
dimension: 'VD_1280x720',
})
const micTrack = await DingRTC.createMicrophoneAudioTrack()
await client.publish([cameraTrack, micTrack]);
通常在user-published回调中进行订阅与设置视图。
// 订阅指定用户视频
client.subscribe(userId, 'video').then((track)=>{
track.play(`#${userId}`)
}).catch((error)=>{
console.log(error.message);
});
// 订阅音频合流
client.subscribe('mcu', 'audio').then((track)=>{
track.play()
}).catch((error)=>{
console.log(error.message);
});
client.leave();
FAQs
dingRTC RTM web端 sdk
The npm package @dingrtc/rtm receives a total of 51 weekly downloads. As such, @dingrtc/rtm popularity was classified as not popular.
We found that @dingrtc/rtm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.