From 2f1ee610d9d7a8ca7ce6f7e3a4cd3a4d8d4759b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Thu, 2 Sep 2021 14:10:28 +0200 Subject: [PATCH] Use source id directly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/@types/global.d.ts | 7 ++++++- .../views/elements/DesktopCapturerSourcePicker.tsx | 5 ++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts index cc6985eb66..8ad93fa960 100644 --- a/src/@types/global.d.ts +++ b/src/@types/global.d.ts @@ -49,7 +49,6 @@ import PerformanceMonitor from "../performance"; import UIStore from "../stores/UIStore"; import { SetupEncryptionStore } from "../stores/SetupEncryptionStore"; import { RoomScrollStateStore } from "../stores/RoomScrollStateStore"; -import { DesktopCapturerSource } from "matrix-js-sdk/src/webrtc/call"; /* eslint-disable @typescript-eslint/naming-convention */ @@ -97,6 +96,12 @@ declare global { electron?: Electron; } + interface DesktopCapturerSource { + id: string; + name: string; + thumbnailURL: string; + } + interface GetSourcesOptions { types: Array; thumbnailSize?: { diff --git a/src/components/views/elements/DesktopCapturerSourcePicker.tsx b/src/components/views/elements/DesktopCapturerSourcePicker.tsx index f014f0e3b8..034fc3d49c 100644 --- a/src/components/views/elements/DesktopCapturerSourcePicker.tsx +++ b/src/components/views/elements/DesktopCapturerSourcePicker.tsx @@ -22,7 +22,6 @@ import classNames from 'classnames'; import AccessibleButton from './AccessibleButton'; import { replaceableComponent } from "../../../utils/replaceableComponent"; import TabbedView, { Tab, TabLocation } from '../../structures/TabbedView'; -import { DesktopCapturerSource } from "matrix-js-sdk/src/webrtc/call"; export function getDesktopCapturerSources(): Promise> { const options: GetSourcesOptions = { @@ -86,7 +85,7 @@ export interface PickerIState { selectedSource: DesktopCapturerSource | null; } export interface PickerIProps { - onFinished(source: DesktopCapturerSource): void; + onFinished(sourceId: string): void; } @replaceableComponent("views.elements.DesktopCapturerSourcePicker") @@ -131,7 +130,7 @@ export default class DesktopCapturerSourcePicker extends React.Component< }; private onShare = (): void => { - this.props.onFinished(this.state.selectedSource); + this.props.onFinished(this.state.selectedSource.id); }; private onTabChange = (): void => {