Lib_Jitsi_Meet API setup errors

I am using the lib_jitsi_meet API to create my own client when hosting the jitsi system on my own computer.
At the moment i am trying to follow the simple setup instruction posted here: lib-jitsi-meet API (low level) | Jitsi Meet

However, when i do as many examples have done online i am getting a bunch of errors.

Below is my java script:

// Initialize the Jitsi Meet API by initializing the jitsiMeetJs object
const initOptions = {
    disableAudioLevels: true
};
JitsiMeetJS.init(initOptions);
console.log("Jitsi Meet API initialized")


// Create the connection object. JS object with config options for the server connection. 
/*const options = { 
    hosts: { // JS object
        domain: '10.47.14.206:8000'
        //muc: 'conference.10.47.14.206:8000'
    },
    serviceUrl: '//10.47.14.206:8000/http-bind'
    //bosh: '//10.47.14.206:8000/http-bind' // DEPRECATED, use serviceUrl to specify either BOSH or Websocket URL. We need to send the BOSH here to connect to prosody. If not we send it to our server/http-bind where it dosen't find what it need. 
};*/
const options = { 
    hosts: { // JS object
        domain: 'beta.meet.jit.si'
        //muc: 'conference.10.47.14.206:8000'
    },
    //serviceUrl: '//10.47.14.206:8000/http-bind',
    bosh: 'https://beta.meet.jit.si/http-bind' // DEPRECATED, use serviceUrl to specify either BOSH or Websocket URL. We need to send the BOSH here to connect to prosody. If not we send it to our server/http-bind where it dosen't find what it need. 
};
var connection = new JitsiMeetJS.JitsiConnection(null, null, options);
console.log("Connection object created")


//Add listeners on the connection object and establish server connection. 
connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED, onConnectionSuccess); // Indicates that we have succsessfully established server connection. 
connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_FAILED, onConnectionFailed); // Indicates that the server connection failes
connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED, disconnect); // Indicates that we are disconnected
connection.connect();

Here i a doing basic stuff. One problem i have is that i am getting the error:

Strophe: BOSH-Connection failed: improper-addressing

This happens when i am using my own hosting jitsi. The options configuration addresses that are commented out.

When i am using the second options which is not commented out in the JS file i get past the error above. Then i am using the serve jitsi is running and not my own jitsi.
But the i get a bunch of error regarding:

Strophe: TypeError: Cannot read properties of undefined (reading ‘toLowerCase’)

This is apperantly happening within the “connection.connect();” code line. I do not understand these errors whit this basic setup.

If anyone has any tips on this it would be greatly appreciated. Mabye there is something in config files that are not correct? I don’t know.

I wonder if all my problems are related to HTTPS, since im using http atm. Does anyone have thoughts on this?

You need https for WebRTC.

1 Like