npm

Need private packages and team management tools?Check out npm Orgs. »

tttwebsdk

1.5.4 • Public • Published

This is libarary of 3t RTN for web. Powered by www.3ttech.cn

Install

npm i tttwebsdk

code sample

const TTTRtcWeb = require('tttwebsdk');
let RTCObj = new TTTRtcWeb();
const client = RTCObj.createClient({role: '2'});
//let appid= '***', roomid = '***', userid= '***'
 
client.init(appid, userid, function () {
    client.join(roomid, function () {
        let stream = RTCObj.createStream({
            streamID: userid,
            audio: true,
            video: true,
            screen: false
        });
 
 
        stream.init(function () {
            stream.play('local_stream');
            client.publish(stream, function success() {
            }, function failure() {
            });
        }
    }, function (err) {
    });
}, function (err) {
});
 
client.on('user-joined', (evt) => {
    console.log('user joined room. uid=', evt.uid);
});
 
client.on('user-leaved', (evt) => {
    console.log('user leaved room. uid=', evt.uid);
});

Keywords

install

npm i tttwebsdk

Downloadsweekly downloads

49

version

1.5.4

license

ISC

last publish

collaborators

  • avatar
Report a vulnerability