How to use the matrix-react-sdk/lib/CallHandler.getCallForRoom 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 / skins / vector / views / molecules / RoomHeader.js View on Github external
if (this.props.simpleHeader) {
            header =
                <div>
                    <div>
                        { this.props.simpleHeader }
                    </div>
                </div>
        }
        else {
            var topic = this.props.room.currentState.getStateEvents('m.room.topic', '');

            var call_buttons;
            if (this.state &amp;&amp; this.state.call_state != 'ended') {
                //var muteVideoButton;
                var activeCall = (
                    CallHandler.getCallForRoom(this.props.room.roomId)
                );
/*                
                if (activeCall &amp;&amp; activeCall.type === "video") {
                    muteVideoButton = (
                        <div>
                            {
                                (activeCall.isLocalVideoMuted() ?
                                    "Unmute" : "Mute") + " video"
                            }
                        </div>
                    );
                }
                        {muteVideoButton}
                        <div></div>
github vector-im / riot-web / src / controllers / molecules / voip / CallView.js View on Github external
showCall: function(roomId) {
        var call = (
            CallHandler.getCallForRoom(roomId) ||
            VectorConferenceHandler.getConferenceCallForRoom(roomId)
        );
        if (call) {
            call.setLocalVideoElement(this.getVideoView().getLocalVideoElement());
            call.setRemoteVideoElement(this.getVideoView().getRemoteVideoElement());
            // give a separate element for audio stream playback - both for voice calls
            // and for the voice stream of screen captures
            call.setRemoteAudioElement(this.getVideoView().getRemoteAudioElement());
        }
        if (call && call.type === "video" && call.state !== 'ended') {
            // if this call is a conf call, don't display local video as the
            // conference will have us in it
            this.getVideoView().getLocalVideoElement().style.display = (
                call.confUserId ? "none" : "initial"
            );
            this.getVideoView().getRemoteVideoElement().style.display = "initial";
github vector-im / riot-web / src / controllers / organisms / RoomView.js View on Github external
case 'message_send_failed':
            case 'message_sent':
                this.setState({
                    hasUnsentMessages: this._hasUnsentMessages(this.state.room)
                });
            case 'message_resend_started':
                this.setState({
                    room: MatrixClientPeg.get().getRoom(this.props.roomId)
                });
                this.forceUpdate();
                break;
            case 'notifier_enabled':
                this.forceUpdate();
                break;
            case 'call_state':
                if (CallHandler.getCallForRoom(this.props.roomId)) {
                    // Call state has changed so we may be loading video elements
                    // which will obscure the message log.
                    // scroll to bottom
                    var scrollNode = this._getScrollNode();
                    if (scrollNode) {
                        scrollNode.scrollTop = scrollNode.scrollHeight;
                    }
                }

                // possibly remove the conf call notification if we're now in
                // the conf
                this._updateConfCallNotification();
                break;
            case 'user_activity':
                this.sendReadReceipt();
                break;
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
        });
    },