发送同步消息后,我在哪里可以捕获来自 Janus WebRTC 服务器的响应

Where can I catch response from Janus WebRTC server after send synchronous message

将 videoroom 插件附加到 Janus 后,在 "success" 回调中我向它发送同步消息

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 获得响应,但在 documentation 中告诉插件将向我发送 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);
    }      
  });