0

我是使用 jitsi 自托管 docker,现在我正在实现 jitsi-meet API ( https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-ljm-api )。

这是我用于连接设置的 JS 代码:

/* 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);

我的码头工人的环境已经这样设置了。但是,在 js 文件中创建的侦听器根本不会被调用。我究竟做错了什么?

# 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
4

0 回答 0