2

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.

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

Thanks in advance

Puppeteer code

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")
Pavindu
  • 2,684
  • 6
  • 44
  • 77
  • Interesting usage! What's your use-case if I may ask? Do you want to record meetings? – Vaviloff Sep 21 '20 at 11:37
  • 1
    We wanted to use jitsi to create a video chat app, without messing with the Jitsi source code. Since there is no server-side API for Jitsi, we emulate using a headless browser. – Pavindu Sep 22 '20 at 07:43

1 Answers1

3

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', 
}
Pavindu
  • 2,684
  • 6
  • 44
  • 77
  • 2
    From the github page of lib-jitsi-meet, it says that bosh is deprecated and we should be using serviceUrl to specify the BOSH or Websocket URL. https://github.com/jitsi/lib-jitsi-meet/blob/master/doc/API.md#installation – Shanmukha Sampath Kumar Nov 24 '20 at 06:58
  • Also, it won't work unless the room name is provided as a query parameter, but didn't found it in the docs but deep down in an old thread in the jitsi community forum. – Pavindu Nov 25 '20 at 08:43
  • Am i supposed to replace all the meet.jit.si's with the domain name of my own jitsi server? – Gandalf Aug 07 '21 at 16:35
  • 1
    @gandalf yes, you need to – Pavindu Aug 08 '21 at 08:01
  • I found it a bit harder than that, which is why I created an example: https://github.com/solarkraft/lib-jitsi-meet-demo/blob/master/src/JitsiMeet.ts – Paul Mar 14 '22 at 17:09