kuaishou-danmaku
v1.0.2
Published
`yarn add douyin-danmaku`
Downloads
3
Readme
这个一个抖音直连的应用 可以直接获取抖音直播间的弹幕 node 端
yarn add douyin-danmaku
const { live, handleMessage, PLATFORM } = require("./bundle.js");
(async () => {
let ws = await live({
roomNumber: "80017709309",
platform: PLATFORM.douyin,
isBrowser: true,//
cb: (msg) => {
console.log(msg);
},
});
setTimeout(() => {
// 如果是 isBrowser=false 必须先removeAllListeners 才能close成功
// 如果是 isBrowser=true 就没必要removeAllListeners 这样才能页面关闭成功
ws.removeAllListeners();
ws.close();
}, 5000);
})();