How to use the matrix-react-sdk/lib/CallHandler.getAnyActiveCall function in matrix-react-sdk

To help you get started, we’ve selected a few matrix-react-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 / VectorConferenceHandler.js View on Github external
module.exports.getConferenceCallForRoom = function(roomId) {
    // search for a conference 1:1 call for this group chat room ID
    var activeCall = CallHandler.getAnyActiveCall();
    if (activeCall && activeCall.confUserId) {
        var thisRoomConfUserId = module.exports.getConferenceUserIdForRoom(
            roomId
        );
        if (thisRoomConfUserId === activeCall.confUserId) {
            return activeCall;
        }
    }
    return null;
};
github vector-im / riot-web / src / components / structures / LeftPanel.js View on Github external
_recheckCallElement: function(selectedRoomId) {
        // if we aren't viewing a room with an ongoing call, but there is an
        // active call, show the call element - we need to do this to make
        // audio/video not crap out
        var activeCall = CallHandler.getAnyActiveCall();
        var callForRoom = CallHandler.getCallForRoom(selectedRoomId);
        var showCall = (activeCall && activeCall.call_state === 'connected' && !callForRoom);
        this.setState({
            showCallElement: showCall
        });
    },
github vector-im / riot-web / src / controllers / organisms / RoomList.js View on Github external
_recheckCallElement: function(selectedRoomId) {
        // if we aren't viewing a room with an ongoing call, but there is an
        // active call, show the call element - we need to do this to make
        // audio/video not crap out
        var activeCall = CallHandler.getAnyActiveCall();
        var callForRoom = CallHandler.getCallForRoom(selectedRoomId);
        var showCall = (activeCall && !callForRoom);
        this.setState({
            show_call_element: showCall
        });
    },
github vector-im / riot-web / src / controllers / molecules / voip / CallView.js View on Github external
componentDidMount: function() {
        this.dispatcherRef = dis.register(this.onAction);
        this._trackedRoom = null;
        if (this.props.room) {
            this._trackedRoom = this.props.room;
            this.showCall(this._trackedRoom.roomId);
        }
        else {
            var call = CallHandler.getAnyActiveCall();
            if (call) {
                console.log(
                    "Global CallView is now tracking active call in room %s",
                    call.roomId
                );
                this._trackedRoom = MatrixClientPeg.get().getRoom(call.roomId);
                this.showCall(call.roomId);
            }
        }
    },
github vector-im / riot-web / src / components / structures / LeftPanel.js View on Github external
onCallViewClick: function() {
        var call = CallHandler.getAnyActiveCall();
        if (call) {
            dis.dispatch({
                action: 'view_room',
                room_id: call.groupRoomId || call.roomId,
            });
        }
    },