Core Events
Updated: 2024-10-10 17:27:10
1. Core Setup Completed Hook
Description: This hook is triggered after a successful call to watchCore.setup.
Event: PolyvWatchCoreEvents.WatchCoreSetuped
Example:
import { createWatchCore, PolyvWatchCoreEvents } from '@polyv/live-watch-miniprogram-sdk';
const watchCore = createWatchCore({
channelId: '频道号'
});
watchCore.setup();
watchCore.eventEmitter.on(PolyvWatchCoreEvents.WatchCoreSetuped, () => {
console.log('安装成功');
});
2. Chat Room Connection Completed Hook
Description: This hook is triggered after a successful call to watchCore.connect to connect to the chat room. Once triggered, the live streaming viewing page can be displayed.
Event: PolyvWatchCoreEvents.WatchCoreConnected
Example:
watchCore.connect();
watchCore.eventEmitter.on(PolyvWatchCoreEvents.WatchCoreConnected, () => {
console.log('连接成功');
});
