Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
dr-liveroom
Advanced tools
使用 npm 安装 sdk:
npm i dr-liveroom
import QueueService from "dl-liveroom";
// userType: staff 为坐席,customer 为用户
const queueService = new QueueService({ userType: "customer" });
// 初始化登录信息
await queueService.loginAsync({
appId: "<appId>",
server: "<server>",
dispatchServer: "<dispatchServer>",
tokenUrl: "<tokenUrl>",
idName: "<idName>"
});
// 获取正在所有排队队列的信息
const queueList = await queueService.getQueueList();
const firstQueue = queueList[0];
// 客户vip信息,0为普通客户,1~9为vip等级客户
const vipInfo = 0;
// 第一个排队队列的数据信息
const {
queueId,
queueName
} = firstQueue;
// 客户进入排队服务队列
const enterRes = await queue.customerEnterQueue({
queueId,
extraInfo: "",
vipInfo: this.state.isVip ? 1 : 0
});
// 坐席进入队列
const enterRes = await queue.staffEnterQueue({
queueId,
queueName,
roomId
});
// 坐席接人
const catchRes = await queue.staffCatch();
// 客户排队服务到达回调
queueService.onCustomerServiceStart(async (para) => {
const { roomId } = para.body;
const reject = false;
// 客户回复排队服务
await queueService.customerReply({
/** 协商id */
consultId,
/** 服务选项 1 同意服务 2 拒绝服务 */
operation: reject ? 2 : 1
});
});
// 坐席收到客户回复
queue.onStaffServiceStart((para) => {
window._openDialog({
content: ["", "Customer is accept service", "Customer is reject service", "Service is timeout", "The customer is quitted queue"][para.body.customerOperation]
});
});
// 进入音视频房间逻辑
// 发布的流视频 id
const publishStreamId = "<publishStreamId>";
// 本地预览 HTMLVideoElement
const localViewEl = "<HTMLVideoElement>";
// 远程流播放 HTMLVideoElement
const remoteViewEl = "<HTMLVideoElement>";
// 进入音视频房间
const streamList = await queueService.enterRoomAsync(roomId);
// 开始预览
await queueService.startPreviewAsync(localViewEl);
// 开始发布视频流
await queueService.startPublish(publishStreamId);
// 开始播放第一个远程视频流
await queueService.playStream({ viewEl: remoteViewEl, streamId: streamList[0].streamId });
// 客户退出排队服务队列
await queueService.customerQuitQueue();
// 组拍戏退出排队服务队列
await queueService.staffQuitQueue();
// 离开音视频房间逻辑
// 离开音视频房间
await queueService.leaveRoom();
// 停止本地预览
await queueService.stopPreview();
// 停止发布视频流
await queueService.stopPublish();
// 停止播放所有远程视频流
await queueService.stopPlayStreams();
// 注册部分事件回调
queueService.onCustomerServiceTimeout = () => {
console.log("is service timeout.");
};
queueService.onUserStateUpdate = (roomId, userList) => {
console.log(roomId, userList);
};
queueService.onRecvCustomCommand = (userId, userName, content) => {
console.log(userId, userName, content);
};
queueService.onStreamUpdated = (type, newStreamList) => {
console.log(type, newStreamList);
};
queueService.onPlayQualityUpdate = (streamId, quality) => {
console.log(streamId, quality);
};
queueService.onTempBroken = () => {
console.log("临时掉线");
};
queueService.onReconnect = () => {
console.log("重连成功");
};
queueService.onKickOut = (err) => {
console.log("被踢下线通知");
};
queueService.onDisconnect = (err) => {
console.log("服务掉线通知");
};
FAQs
Zego double record service with liveroom.
The npm package dr-liveroom receives a total of 0 weekly downloads. As such, dr-liveroom popularity was classified as not popular.
We found that dr-liveroom demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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 removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.