Get screen-sharing working, somehow

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2020-12-26 08:32:51 +01:00
parent 777c0ca1ef
commit eae3c1c496
3 changed files with 206 additions and 1 deletions

View File

@@ -82,6 +82,13 @@ import CountlyAnalytics from "./CountlyAnalytics";
import {UIFeature} from "./settings/UIFeature";
import { CallError } from "matrix-js-sdk/src/webrtc/call";
import { logger } from 'matrix-js-sdk/src/logger';
import DesktopCapturerSourcePicker from "./components/views/elements/DesktopCapturerSourcePicker"
export interface ElectronDesktopCapturerSource {
display_id: string;
id: string;
name: string;
}
enum AudioID {
Ring = 'ringAudio',
@@ -474,7 +481,23 @@ export default class CallHandler {
});
return;
}
call.placeScreenSharingCall(remoteElement, localElement);
const selectDesktopCapturerSource = async (
sources: Array<ElectronDesktopCapturerSource>,
): Promise<ElectronDesktopCapturerSource> => {
console.log(DesktopCapturerSourcePicker);
const params = {
sources: sources,
};
const {finished} = Modal.createDialog(DesktopCapturerSourcePicker, params);
const [source] = await finished;
console.log("Dialog closed with", source);
return source;
};
call.placeScreenSharingCall(remoteElement, localElement, selectDesktopCapturerSource);
} else {
console.error("Unknown conf call type: %s", type);
}