I am self hosting docker with jitsi and now I am implementing jitsi-meet API (https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-ljm-api).
Here is my JS code for connection setup:
/* global $, JitsiMeetJS */
let connection;
const options = {
hosts: {
domain: 'myTest.jitsi.conf',
muc: 'conference.myTest.jitsi.conf'
},
bosh: '//myTest.jitsi.conf:8443/http-bind'
};
const confOptions = {
openBridgeChannel: true
};
JitsiMeetJS.init();
connection = new JitsiMeetJS.JitsiConnection(null, null, options);
function onConnectionSuccess() {
console.log("onConnectionSuccess")
const room = connection.initJitsiConference("conference", confOptions);
room.on(JitsiMeetJS.events.conference.TRACK_ADDED, onRemoteTrack);
room.on(JitsiMeetJS.events.conference.CONFERENCE_JOINED, onConferenceJoined);
room.join();
}
function onConnectionFailed() {
console.log("onConnectionFailed")
}
function disconnect() {
console.log("disconnect")
}
function onRemoteTrack() {
console.log("onRemoteTrack")
}
function onConferenceJoined() {
console.log("onConferenceJoined")
}
connection.addEventListener(
JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,
onConnectionSuccess);
connection.addEventListener(
JitsiMeetJS.events.connection.CONNECTION_FAILED,
onConnectionFailed);
connection.addEventListener(
JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,
disconnect);
connection.connect();
JitsiMeetJS.createLocalTracks().then(onLocalTracks);
And my docker's env has set up this way. However the listeners that are created inside js file do not get called at all. What am I doing wrong?
# Directory where all configuration will be stored
CONFIG=~/.jitsi-meet-cfg
# Exposed HTTP port
HTTP_PORT=8000
# Exposed HTTPS port
HTTPS_PORT=8443
# System time zone
TZ=UTC
# Public URL for the web service (required)
PUBLIC_URL=https:///myTest.jitsi.conf/
# IP address of the Docker host
# See the "Running behind NAT or on a LAN environment" section in the Handbook:
# https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-docker#running-behind-nat-or-on-a-lan-environment
#DOCKER_HOST_ADDRESS=192.168.1.1