核心事件
一、核心安装完成钩子
说明: 调用 watchCore.setup
安装成功后触发该钩子。
Event 事件: PolyvWatchCoreEvents.WatchCoreSetuped
示例:
import { createWatchCore, PolyvWatchCoreEvents } from '@polyv/live-watch-miniprogram-sdk';
const watchCore = createWatchCore({
channelId: '频道号'
});
watchCore.setup();
watchCore.eventEmitter.on(PolyvWatchCoreEvents.WatchCoreSetuped, () => {
console.log('安装成功');
});
二、聊天室连接完成钩子
说明: 调用 watchCore.connect
连接聊天室完成后触发该钩子,触发后即可显示直播观看页。
Event 事件: PolyvWatchCoreEvents.WatchCoreConnected
示例:
watchCore.connect();
watchCore.eventEmitter.on(PolyvWatchCoreEvents.WatchCoreConnected, () => {
console.log('连接成功');
});
Last updated
Was this helpful?