Real time Interactive Education Edition (formerly Low Code Interactive Classroom, LCIC) is a multifunctional product that integrates audio and video connectivity, interactive whiteboard, and live streaming
( https://www.tencentcloud.com/document/product/1168/53651 )
This project is a client-side JavaScript SDK (demo), which allows you to develop and customize your own real-time interactive applications based on the SDK
Room: The room represents a globally unique spatiotemporal place where real-time interaction occurs, identified by the room ID, and can be created by Tencent Cloud API( https://www.tencentcloud.com/document/product/1168/52794 ), then you can call the SDK method to join the room and start publishing audio and video streams in the room
The SDK mainly includes the following modules:
-TCIC: Packaging the original educational version of concepts such as rooms/homeowners/spectators, supporting the basic operations of these objects.
-TIM: Supports real-time data communication within the room, such as chatting, all staff messaging, etc. It can achieve various business models such as all staff answering, announcements, gift distribution, etc.
-TRTC: Real time video call function packaging, which can achieve functions such as connected voice calls.
https://dev-class.qcloudclass.com/next/
https://github.com/tencentyun/lcic-UIlessdemo
npm install --save tric-sdk-v1
yarn add tric-sdk-v1
import * as SDK from 'tric-sdk-v1';
const tcic = SDK.create({
userId: 'xxx'; //
token: 'token_of_the_userid';
classId: 345678; // got from cloud api
});
const trtcClient = SDK.createTrtcClient(tcic);
await tcic.init();
const tim = SDK.createTimClient(tcic);
trtcClient.localPreview({
view: 'dom-id',
});
await tcic.start();
await trtcClient.enterRoom();
trtcClient.pausePublish({
target: ['video', 'audio'],
});
trtcClient.resumePublish({
target: ['video', 'audio'],
});
tcic.getMembersDetail(classId, {
page: 1,
limit: 100,
});
trtcClient.startRemote({
view: `dom-id`,
streamType: 'main',
userId: 'remote-user-id',
});
await tcic.end()
const teduBoard = SDK.createTiw(tcic, 'your-white-board-container-dom-id').instance;
// set up event listeners.
teduBoard.on(TEduBoard.EVENT.TEB_ERROR, (errorCode, errorMessage) => {
console.log('======================: ', 'TEB_ERROR', ' errorCode:', errorCode, ' errorMessage:', errorMessage);
});
teduBoard.on(TEduBoard.EVENT.TEB_WARNING, (warnCode, warnMessage) => {
console.log('======================: ', 'TEB_WARNING', ' warnCode:', warnCode, ' warnMessage:', warnMessage);
});
teduBoard.on(TEduBoard.EVENT.TEB_HISTROYDATA_SYNCCOMPLETED, () => {
console.log('======================: ', 'TEB_HISTROYDATA_SYNCCOMPLETED');
});
Synchronize whiteboard operations to remote users by tim.
// Monitor operations of local whiteboard and sync the operation to the remote user's whiteboard use the tim instance
teduBoard.on(TEduBoard.EVENT.TEB_SYNCDATA, data => {
tim.sendRoomCustomMsg({
data: JSON.stringify(data),
extension: 'TXWhiteBoardExt'
}).then(() => {
// sync sucess.
}, () => {
// sync failed.
});
});
On the remote side:
tim.on('customMsg', (data, msg)=>{
if (msg.data?.content?.extension === 'TXWhiteBoardExt') {
if (msg.from != tcic.userId) { // filter out messages sent by yourself.
teduBoard.addSyncData(data);
}
}
});
...
for more reference, see: https://doc.qcloudtiw.com/web/official/tutorial-tutorial-2-1.html
https://docs.qcloudclass.com/latest/tcic_engine/modules.html
The SDK is still under rapid iterative development stage. The subsequent new version will release a signal-based data flow SDK, which will further simplify the usage and add more enhanced and rich capabilities, so stay tuned.
实时互动-教育版(原低代码互动课堂,LCIC)是一款集成音视频连麦、互动白板和直播等多功能的产品. (https://cloud.tencent.com/document/product/1639)
本项目是客户端js SDK (demo), 您可以基于SDK开发定制您自己的实时互动应用
房间: 房间代表一场是全局唯一的实时互动发生的时空场所,用房间ID标识, 您可以通过云api接口(https://cloud.tencent.com/document/product/1639/80942) 创建房间, 然后调用SDK的方法加入房间并开始在房间发布音视频流
SDK主要包含以下模块:
npm install --save tric-sdk-v1
yarn add tric-sdk-v1
import * as SDK from 'tric-sdk-v1';
const tcic = SDK.create({
userId: 'xxx'; //
token: 'token_of_the_userid';
classId: 345678; // got from cloud api
});
const trtcClient = SDK.createTrtcClient(tcic);
await tcic.init();
const tim = SDK.createTimClient(tcic);
trtcClient.localPreview({
view: 'dom-id',
});
await tcic.start();
await trtcClient.enterRoom();
trtcClient.pausePublish({
target: ['video', 'audio'],
});
trtcClient.resumePublish({
target: ['video', 'audio'],
});
tcic.getMembersDetail(classId, {
page: 1,
limit: 100,
});
trtcClient.startRemote({
view: `dom-id`,
streamType: 'main',
userId: 'remote-user-id',
});
await tcic.end()
https://docs.qcloudclass.com/latest/tcic_engine/modules.html
SDK仍处在快速迭代开发中, 后续新版本将会发布基于signal的数据流SDK, 会进一步简化使用流程, 并加入更多增强丰富的能力,敬请期待.
Generated using TypeDoc