How to use the matrix-js-sdk.createNewMatrixCall function in matrix-js-sdk

To help you get started, we’ve selected a few matrix-js-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vector-im / riot-web / src / CallHandler.js View on Github external
}
                else {
                    console.error("Unknown conf call type: %s", payload.type);
                }
            }

            var members = room.getJoinedMembers();
            if (members.length <= 1) {
                Modal.createDialog(ErrorDialog, {
                    description: "You cannot place a call with yourself."
                });
                return;
            }
            else if (members.length === 2) {
                console.log("Place %s call in %s", payload.type, payload.room_id);
                var call = Matrix.createNewMatrixCall(
                    MatrixClientPeg.get(), payload.room_id
                );
                placeCall(call);
            }
            else { // > 2
                console.log("Place conference call in %s", payload.room_id);
                var confCall = new ConferenceCall(
                    MatrixClientPeg.get(), payload.room_id
                );
                confCall.setup().done(function(call) {
                    placeCall(call);
                }, function(err) {
                    console.error("Failed to setup conference call: %s", err);
                });
            }
            break;
github FabricLabs / fabric / src / CallHandler.js View on Github external
const room = MatrixClientPeg.get().getRoom(payload.room_id);
                if (!room) {
                    console.error("Room %s does not exist.", payload.room_id);
                    return;
                }

                const members = room.getJoinedMembers();
                if (members.length <= 1) {
                    const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
                    Modal.createTrackedDialog('Call Handler', 'Cannot place call with self', ErrorDialog, {
                        description: _t('You cannot place a call with yourself.'),
                    });
                    return;
                } else if (members.length === 2) {
                    console.log("Place %s call in %s", payload.type, payload.room_id);
                    const call = Matrix.createNewMatrixCall(MatrixClientPeg.get(), payload.room_id);
                    placeCall(call);
                } else { // > 2
                    dis.dispatch({
                        action: "place_conference_call",
                        room_id: payload.room_id,
                        type: payload.type,
                        remote_element: payload.remote_element,
                        local_element: payload.local_element,
                    });
                }
            }
            break;
        case 'place_conference_call':
            console.log("Place conference call in %s", payload.room_id);
            _startCallApp(payload.room_id, payload.type);
            break;
github vector-im / riot-web / src / VectorConferenceHandler.js View on Github external
}).then(function(room) {
        // return a call for *this* room to be placed. We also tack on
        // confUserId to speed up lookups (else we'd need to loop every room
        // looking for a 1:1 room with this conf user ID!)
        var call = Matrix.createNewMatrixCall(self.client, room.roomId);
        call.confUserId = self.confUserId;
        call.groupRoomId = self.groupRoomId;
        return call;
    });
};
github FabricLabs / fabric / src / VectorConferenceHandler.js View on Github external
}).then(function(room) {
        // return a call for *this* room to be placed. We also tack on
        // confUserId to speed up lookups (else we'd need to loop every room
        // looking for a 1:1 room with this conf user ID!)
        var call = Matrix.createNewMatrixCall(self.client, room.roomId);
        call.confUserId = self.confUserId;
        call.groupRoomId = self.groupRoomId;
        return call;
    });
};