gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 07:20:52 24 4
gpt4 key购买 nike

将 videoroom 插件附加到 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 获得响应,但在 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);
}
});

关于javascript - 发送同步消息后,我在哪里可以捕获 Janus WebRTC 服务器的响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53253948/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com