Failure to start Jitsi Meet API - lib-jitsi-Meet error in initJitsiConference (Typeerror: Cannot read Property 'substr' of null)

Asked

Viewed 182 times

-1

Hello! I’m trying to use the Jitsi Meet API to create video conferencing with the customized GUI and I tried to follow the guidelines of documentation but I did not succeed, I always get the same error.

I’m getting a Uncaught TypeError: Cannot read property 'substr' of null when I create the Jitsiconference object -> initJitsiConference().

Features of the server environment:

  • The default Jitsi Meet installation has not changed;
  • I did not install / configured the Prosody JWT token authentication plug-in;
  • I’m running the test.html application on a domain, for example: https://mydomain1.com and Jitsi Meet in another domain, for example: https://meet.myotherdomain2.com

I get the following error message (Chrome console): inserir a descrição da imagem aqui

Gazing JitsiConference.js on line 276, I see the following: inserir a descrição da imagem aqui

My API javascript (mydomain.com/test.html) looks like this:

<script src="vendor/jquery/jquery-3.4.1.min.js"></script>
<script src="https://meet.jit.si/libs/lib-jitsi-meet.min.js"></script>
<script type="text/javascript">
JitsiMeetJS.init();

const options = {
    serviceUrl:'https://meet.jit.si/http-bind',
    hosts: {
        domain: 'meet.jit.si',
        muc: 'conference.meet.jit.si',
    },
    bosh: 'https://meet.jit.si/http-bind',
    useStunTurn: true
}

var connection = new JitsiMeetJS.JitsiConnection(null, null, options);

const confOptions = {
    openBridgeChannel: true
}

room = connection.initJitsiConference("testconference1", confOptions);
</script>

I tried to work with other public bodies:

  • Meet.jitsi.
  • jitsi2.linux.it
  • jitsi-1.belnet.be
  • jitsi.riotim.
  • de-bra-1.jitsi.Rocks
  • Meet.xrv.pt

And got similar errors (Chrome console):

Uncaught TypeError: Cannot read property 'substr' of null - JitsiConference.js:263 
    at oe.resourceCreator (JitsiConference.js:263)
    at t.value (xmpp.js:461)
    at oe._init (JitsiConference.js:297)
    at new oe (JitsiConference.js:127)
    at c.initJitsiConference (JitsiConnection.js:113)

Log file (Jicofo.log) found [WARNING] and [SEVERE]

Jicofo 2020-05-15 20:05:23.771 WARNING: [22] org.jitsi.jicofo.FocusManager.log() No dedicated JVB MUC XMPP connection configured - falling back to the default XMPP connection
...
Jicofo 2020-05-15 20:05:24.335 SEVERE: [28] org.jitsi.impl.protocol.xmpp.OpSetSimpleCapsImpl.getFeatures().144 Failed to discover features for speakerstats.meet.myserver.com: XMPP error reply received from speakerstats.meet.myserver.com: XMPPError: service-unavailable - cancel
Jicofo 2020-05-15 20:05:24.337 SEVERE: [28] org.jitsi.impl.protocol.xmpp.OpSetSimpleCapsImpl.getFeatures().144 Failed to discover features for focus.meet.myserver.com: XMPP error reply received from focus.meet.myserver.com: XMPPError: service-unavailable - wait
Jicofo 2020-05-15 20:05:24.345 SEVERE: [28] org.jitsi.impl.protocol.xmpp.OpSetSimpleCapsImpl.getFeatures().144 Failed to discover features for conferenceduration.meet.myserver.com: XMPP error reply received from conferenceduration.meet.myserver.com: XMPPError: service-unavailable - cancel
...
Jicofo 2020-05-15 20:05:29.629 WARNING: [40] org.jitsi.jicofo.bridge.BridgeSelector.log() No pub-sub node mapped for [email protected]/2671872e-fccb-49e9-866b-28813c831825
...
Jicofo 2020-05-15 20:05:29.651 INFO: [55] org.jitsi.jicofo.bridge.JvbDoctor.log() Scheduled health-check task for: [email protected]/2671872e-fccb-49e9-866b-28813c831825
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.dom4j.io.SAXContentHandler (file:/usr/share/jicofo/lib/dom4j-1.6.1.jar) to method com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser$LocatorProxy.getEncoding()
WARNING: Please consider reporting this to the maintainers of org.dom4j.io.SAXContentHandler
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Log file (jvb.log) found [WARNING]

2020-05-15 20:05:24.645 WARNING: [22] Videobridge.start#906: No authorized source regexp configured. Will accept requests from any source.

What mistake I must be making?

Thanks in advance for all the help!

1 answer

0

Looking more carefully, I concluded I wasn’t expecting (addEventListener) by CONECTION_ESTABLISHED event and with some modifications to the code...

I also withdrew the option bosh: 'https://meet.jit.si/http-bind' because it seems to be obsolete.

I included javascritps dependencies:

<script src="https://cdn.jsdelivr.net/npm/strophe.js"></script>
<script src="https://cdn.jsdelivr.net/npm/strophejs-plugin-disco/lib/strophe.disco.js?v=1"></script>

Code with the modifications:

<script src="vendor/jquery/jquery-3.4.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/strophe.js"></script>
<script src="https://cdn.jsdelivr.net/npm/strophejs-plugin-disco/lib/strophe.disco.js?v=1"></script>
<script src="https://meet.jit.si/libs/lib-jitsi-meet.min.js"></script>
<script>

function onConnectionSuccess(){
    const confOptions = {
        openBridgeChannel: true
    }
    room = connection.initJitsiConference("abcdef", confOptions);
    room.join();
    room.myUserId();
    console.log('CONNECTION_ESTABLISHED');
}

JitsiMeetJS.init();

JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);

const options = {
    serviceUrl:'https://meet.jit.si/http-bind',
    hosts: {
        domain: 'meet.jit.si',
        muc: 'conference.meet.jit.si',
    }
}

var connection = new JitsiMeetJS.JitsiConnection(null, null, options);

connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED, onConnectionSuccess);

connection.connect();

</script>

See that in the API documentation in item 4 of "Getting Started", The orientation is to wait for the CONECTION_ESTABLISHED event and only then create the Jitsiconference object. Now it seems that everything is working properly.

Thank you all for your time and dedication.

P.S.: I am new to Stackoverflow and I am committed to giving the best response that can help the community.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.