将视频室插件附加到Janus后,在"成功"回调中,我向其发送同步消息
janus.attach(
{
plugin: "janus.plugin.videoroom",
opaqueId: opaqueId,
success: function(pluginHandle) {
roomMaster = pluginHandle;
var isExist = {
"request" : "exists",
"room" : myroom
};
roomMaster.send({"message": isExist})
},
并在控制台中从janus.js
获得响应,但在文档中告诉插件将向我发送response
消息。我不明白——我在哪里能抓到它?
onmessage: function(msg, jsep){
// is fired only after sending async requests like "join", "start" - not "exists"
conslole.log(msg);
}
有人知道吗?
谢谢
您可以在请求对象中定义一个成功回调:
roomHandle.send({
"message" : {
request : 'list'
},
success: function(result) {
console.log(result);
}
});