mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-18 22:58:18 +08:00
Remove screensharing call type
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
69b0425c10
commit
2749715050
@ -80,7 +80,6 @@ import CountlyAnalytics from "./CountlyAnalytics";
|
|||||||
import {UIFeature} from "./settings/UIFeature";
|
import {UIFeature} from "./settings/UIFeature";
|
||||||
import { CallError } from "matrix-js-sdk/src/webrtc/call";
|
import { CallError } from "matrix-js-sdk/src/webrtc/call";
|
||||||
import { logger } from 'matrix-js-sdk/src/logger';
|
import { logger } from 'matrix-js-sdk/src/logger';
|
||||||
import DesktopCapturerSourcePicker from "./components/views/elements/DesktopCapturerSourcePicker"
|
|
||||||
import { Action } from './dispatcher/actions';
|
import { Action } from './dispatcher/actions';
|
||||||
import VoipUserMapper from './VoipUserMapper';
|
import VoipUserMapper from './VoipUserMapper';
|
||||||
import { addManagedHybridWidget, isManagedHybridWidgetEnabled } from './widgets/ManagedHybrid';
|
import { addManagedHybridWidget, isManagedHybridWidgetEnabled } from './widgets/ManagedHybrid';
|
||||||
@ -129,14 +128,9 @@ interface ThirdpartyLookupResponse {
|
|||||||
fields: ThirdpartyLookupResponseFields,
|
fields: ThirdpartyLookupResponseFields,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unlike 'CallType' in js-sdk, this one includes screen sharing
|
|
||||||
// (because a screen sharing call is only a screen sharing call to the caller,
|
|
||||||
// to the callee it's just a video call, at least as far as the current impl
|
|
||||||
// is concerned).
|
|
||||||
export enum PlaceCallType {
|
export enum PlaceCallType {
|
||||||
Voice = 'voice',
|
Voice = 'voice',
|
||||||
Video = 'video',
|
Video = 'video',
|
||||||
ScreenSharing = 'screensharing',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum CallHandlerEvent {
|
export enum CallHandlerEvent {
|
||||||
@ -689,25 +683,6 @@ export default class CallHandler extends EventEmitter {
|
|||||||
call.placeVoiceCall();
|
call.placeVoiceCall();
|
||||||
} else if (type === 'video') {
|
} else if (type === 'video') {
|
||||||
call.placeVideoCall();
|
call.placeVideoCall();
|
||||||
} else if (type === PlaceCallType.ScreenSharing) {
|
|
||||||
const screenCapErrorString = PlatformPeg.get().screenCaptureErrorString();
|
|
||||||
if (screenCapErrorString) {
|
|
||||||
this.removeCallForRoom(roomId);
|
|
||||||
console.log("Can't capture screen: " + screenCapErrorString);
|
|
||||||
Modal.createTrackedDialog('Call Handler', 'Unable to capture screen', ErrorDialog, {
|
|
||||||
title: _t('Unable to capture screen'),
|
|
||||||
description: screenCapErrorString,
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
call.placeScreenSharingCall(
|
|
||||||
async (): Promise<DesktopCapturerSource> => {
|
|
||||||
const {finished} = Modal.createDialog(DesktopCapturerSourcePicker);
|
|
||||||
const [source] = await finished;
|
|
||||||
return source;
|
|
||||||
},
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
console.error("Unknown conf call type: " + type);
|
console.error("Unknown conf call type: " + type);
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ import RoomTopic from "../elements/RoomTopic";
|
|||||||
import RoomName from "../elements/RoomName";
|
import RoomName from "../elements/RoomName";
|
||||||
import {PlaceCallType} from "../../../CallHandler";
|
import {PlaceCallType} from "../../../CallHandler";
|
||||||
import {replaceableComponent} from "../../../utils/replaceableComponent";
|
import {replaceableComponent} from "../../../utils/replaceableComponent";
|
||||||
|
import Modal from '../../../Modal';
|
||||||
|
|
||||||
@replaceableComponent("views.rooms.RoomHeader")
|
@replaceableComponent("views.rooms.RoomHeader")
|
||||||
export default class RoomHeader extends React.Component {
|
export default class RoomHeader extends React.Component {
|
||||||
@ -118,6 +119,10 @@ export default class RoomHeader extends React.Component {
|
|||||||
return !(currentPinEvent.getContent().pinned && currentPinEvent.getContent().pinned.length <= 0);
|
return !(currentPinEvent.getContent().pinned && currentPinEvent.getContent().pinned.length <= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_displayInfoDialogAboutScreensharing() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let searchStatus = null;
|
let searchStatus = null;
|
||||||
let cancelButton = null;
|
let cancelButton = null;
|
||||||
@ -241,8 +246,8 @@ export default class RoomHeader extends React.Component {
|
|||||||
videoCallButton =
|
videoCallButton =
|
||||||
<AccessibleTooltipButton
|
<AccessibleTooltipButton
|
||||||
className="mx_RoomHeader_button mx_RoomHeader_videoCallButton"
|
className="mx_RoomHeader_button mx_RoomHeader_videoCallButton"
|
||||||
onClick={(ev) => this.props.onCallPlaced(
|
onClick={(ev) => ev.shiftKey ?
|
||||||
ev.shiftKey ? PlaceCallType.ScreenSharing : PlaceCallType.Video)}
|
this._displayInfoDialogAboutScreensharing() : this.props.onCallPlaced(PlaceCallType.Video)}
|
||||||
title={_t("Video call")} />;
|
title={_t("Video call")} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user