matrix-org / matrix-js-sdk

Matrix Client-Server SDK for JavaScript
Apache License 2.0
1.53k stars 580 forks source link

GroupCall/Conference example #3889

Open ruocogito opened 9 months ago

ruocogito commented 9 months ago

Hello, i'm now implementing matrix support in my app by this matrix-js-sdk. Chat & 1v1 video calls works fine.

But i can't found any GroupCall/Conference example.

This not work:


 let placeCallFunc = x => {
                    if(x === null) return false;

                    x.updateParticipants()
                    x.initLocalCallFeed();
                    x.placeOutgoingCalls();
                    return true
                }

                let c = this.matrixClient.getGroupCallForRoom(roomId)
                placeCallFunc(c) || this.matrixClient.createGroupCall(
                    roomId,
                    devices["videoinput"] ? "m.video" : "m.voice",
                    false,
                    "m.room",
                    true,
                    {
                    maxPacketLifeTime: null,
                    maxRetransmits: null,
                    ordered: true,
                    protocol: "udp" 
                }).
                 then(
                     c => {
                         placeCallFunc(c)

Can your place correct order for using methods for create group video cals? Or any working example.

... I research code of element, they use jitsi for conference call, i want make it by pure matrix-js-sdk. This try not work too:

if(groupCall === null && roomId) {
           client.createGroupCall(
               roomId,
               "m.video",
               false,
               "m.prompt");

           groupCall = client.getGroupCallForRoom(roomId)
           await sleep(10);
       }
        if(groupCall === null) return
        //groupCall.addListener("feeds_changed", onFeedsChanged);
        groupCall.enter();
        addListeners(groupCall);

Test part of matrix-js-sdk use simple create group call and enter, and commented that sleep 10 ms to "wait for calls" but i have not any call.

raguct25 commented 7 months ago

Hello, i'm now implementing matrix support in my app by this matrix-js-sdk. Chat & 1v1 video calls works fine.

But i can't found any GroupCall/Conference example.

This not work:


 let placeCallFunc = x => {
                    if(x === null) return false;

                    x.updateParticipants()
                    x.initLocalCallFeed();
                    x.placeOutgoingCalls();
                    return true
                }

                let c = this.matrixClient.getGroupCallForRoom(roomId)
                placeCallFunc(c) || this.matrixClient.createGroupCall(
                    roomId,
                    devices["videoinput"] ? "m.video" : "m.voice",
                    false,
                    "m.room",
                    true,
                    {
                    maxPacketLifeTime: null,
                    maxRetransmits: null,
                    ordered: true,
                    protocol: "udp" 
                }).
                 then(
                     c => {
                         placeCallFunc(c)

Can your place correct order for using methods for create group video cals? Or any working example.

... I research code of element, they use jitsi for conference call, i want make it by pure matrix-js-sdk. This try not work too:

if(groupCall === null && roomId) {
           client.createGroupCall(
               roomId,
               "m.video",
               false,
               "m.prompt");

           groupCall = client.getGroupCallForRoom(roomId)
           await sleep(10);
       }
        if(groupCall === null) return
        //groupCall.addListener("feeds_changed", onFeedsChanged);
        groupCall.enter();
        addListeners(groupCall);

Test part of matrix-js-sdk use simple create group call and enter, and commented that sleep 10 ms to "wait for calls" but i have not any call.

Hi @ruocogito you have said 1v1 video calls works fine for you. In my side , Audio call is working fine but the video call not working .I little stuck in video call one to one communication part. can you explain how to stream video and render in view part..

ruocogito commented 7 months ago

can you explain how to stream video and render in view part

Standard git example for 1v1 videocalls works fine, link. It is easy to modiffy it for own ui. I'm using own synapse matrix server with coturn. But no working examples for group call