From 781ff323db4c70e4ca476f9ef13a04e5aa063585 Mon Sep 17 00:00:00 2001 From: enahum Date: Fri, 16 Sep 2016 15:35:13 -0300 Subject: Webrtc client side (#4026) * WebRTC Server side * WebRTC client side * Bug fixes and improvements * Pushing UI improvements for webrtc (#3728) * Pushing UI improvements for webrtc * Updating webrtc css * PLT-3943 WebRTC P1: bug fixes and improvements * Video resolution set to std, reduce volume of ringtone and flip video horizontally * Fix calling a user B while WebRTC RHS is still opened * Leave RHS opened when call ends, Fix isBusy on popover and channel_header * Fix pre-release feature, RHS & System Console * PLT-3945 - Updating UI for webrtc (#3908) * PLT-3943 Webrtc p1 * Add ongoing call indicator when RHS is opened * UI updates to to webrtc notifcation (#3959) --- webapp/actions/webrtc_actions.jsx | 20 ++++++++++++++++++++ webapp/actions/websocket_actions.jsx | 14 +++++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 webapp/actions/webrtc_actions.jsx (limited to 'webapp/actions') diff --git a/webapp/actions/webrtc_actions.jsx b/webapp/actions/webrtc_actions.jsx new file mode 100644 index 000000000..444eee241 --- /dev/null +++ b/webapp/actions/webrtc_actions.jsx @@ -0,0 +1,20 @@ +// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +import AppDispatcher from 'dispatcher/app_dispatcher.jsx'; +import {WebrtcActionTypes} from 'utils/constants.jsx'; + +export function initWebrtc(userId, isCalling) { + AppDispatcher.handleServerAction({ + type: WebrtcActionTypes.INITIALIZE, + user_id: userId, + is_calling: isCalling + }); +} + +export function handle(message) { + AppDispatcher.handleServerAction({ + type: message.action, + message + }); +} diff --git a/webapp/actions/websocket_actions.jsx b/webapp/actions/websocket_actions.jsx index 68853c229..c69c8e6d2 100644 --- a/webapp/actions/websocket_actions.jsx +++ b/webapp/actions/websocket_actions.jsx @@ -15,6 +15,7 @@ import NotificationStore from 'stores/notification_store.jsx'; //eslint-disable- import Client from 'client/web_client.jsx'; import WebSocketClient from 'client/web_websocket_client.jsx'; +import * as WebrtcActions from './webrtc_actions.jsx'; import * as Utils from 'utils/utils.jsx'; import * as AsyncClient from 'utils/async_client.jsx'; @@ -22,9 +23,7 @@ import * as GlobalActions from 'actions/global_actions.jsx'; import * as UserActions from 'actions/user_actions.jsx'; import {handleNewPost} from 'actions/post_actions.jsx'; -import Constants from 'utils/constants.jsx'; -const SocketEvents = Constants.SocketEvents; -const ActionTypes = Constants.ActionTypes; +import {Constants, SocketEvents, ActionTypes} from 'utils/constants.jsx'; import {browserHistory} from 'react-router/es6'; @@ -160,6 +159,10 @@ function handleEvent(msg) { handleHelloEvent(msg); break; + case SocketEvents.WEBRTC: + handleWebrtc(msg); + break; + default: } } @@ -293,3 +296,8 @@ function handleHelloEvent(msg) { Client.serverVersion = msg.data.server_version; AsyncClient.checkVersion(); } + +function handleWebrtc(msg) { + const data = msg.data; + return WebrtcActions.handle(data); +} \ No newline at end of file -- cgit v1.2.3-1-g7c22