// script 标签引入,根据版本号引入JS版本。
<script src="https://websdk.videocc.net/interactions-receive-sdk/0.24.0/lib/polyv-ir.umd.js"></script>
<script>
const { QuestionAnswer } = window.PolyvIRSDK;
</script>
import { QuestionAnswer } from '@polyv/interactions-receive-sdk';
const questionAnswerSdk = new QuestionAnswer();
questionAnswerSdk.on(questionAnswerSdk.events.ANSWER, (msg)) => {
console.log('讲师回复消息' msg.data);
})
questionAnswerSdk.on(questionAnswerSdk.events.DELETE_ANSWER, (msg)) => {
console.log('删除消息' msg.data);
})
questionAnswerSdk.on(questionAnswerSdk.events.UPDATE_SESSIONID, ()) => {
console.log('sessionId改变');
})
// content 问题内容
questionAnswerSdk.sendQuestion(content);