本文介绍了无法在无头浏览器中加入 lib-jitsi-meet 创建的会议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在使用 Puppeteer 的无头 Chrome 实例中使用 lib-jitsi-meet 创建会议,并使用来自另一个浏览器的 Jitsi External API (iframe API) 加入会议.目前,我可以在无头浏览器中创建会议,但无法从其他浏览器加入创建的会议.当我尝试这样做时,创建了另一个同名的新会议,我是其中唯一的参与者.

I'm trying to create a conference using lib-jitsi-meet in a headless Chrome instance using Puppeteer and join it using the Jitsi External API (iframe API) from another browser. Currently, I can create a meeting in a headless browser, but I can't join the created meeting from another browser. When I tried so, another new conference with the same name is created and I'm the only participant in it.

有人可以就这个问题向我提供有用的建议吗?您可以查看 index.html 和 example.js.

Can someone provide me with helpful advice on this problem? You can view the index.html and example.js.

提前致谢

人偶代码

const browser = await puppeteer.launch({
headless: false,
product: 'chrome',
// args: ['wait-for-browser'],
defaultViewport: { width: 1600, height: 1600 },
});
const page = (await browser.pages())[0];
await page.goto("https://jitsi-liveroom.s3.eu-central-1.amazonaws.com/index.html")

推荐答案

使用以下 options 对象作为 example.jsJitsiConnection 的参数,我能够避免 CORS 错误并将多个用户加入同一个会议.

Using the following options object as a param to the JitsiConnection in example.js, I was able to avoid CORS errors and join multiple users to the same conference.

const [meetingName,setMeetingName] = useState("")

const options = {
   hosts: {
      domain: 'meet.jit.si',
      muc: 'conference.meet.jit.si', 
      focus: 'focus.meet.jit.si',
   }, 
   externalConnectUrl: 'https://meet.jit.si/http-pre-bind', 
   enableP2P: true, 
   p2p: { 
      enabled: true, 
      preferH264: true, 
      disableH264: true, 
      useStunTurn: true,
   }, 
   useStunTurn: true, 
   bosh: `https://meet.jit.si/http-bind?room=${meetingName}`, 
   websocket: 'wss://meet.jit.si/xmpp-websocket', 
   clientNode: 'http://jitsi.org/jitsimeet', 
}

这篇关于无法在无头浏览器中加入 lib-jitsi-meet 创建的会议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 19:16