1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Update thumbnails

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2021-01-14 12:44:50 +01:00
parent c13813348d
commit 349bb2730a

View File

@@ -185,6 +185,21 @@ const FALLBACK_ICE_SERVER = 'stun:turn.matrix.org';
/** The length of time a call can be ringing for. */ /** The length of time a call can be ringing for. */
const CALL_TIMEOUT_MS = 60000; const CALL_TIMEOUT_MS = 60000;
/** Retrieves sources from desktopCapturer */
export function getDesktopCapturerSources(): Promise<Array<DesktopCapturerSource>> {
const options: GetSourcesOptions = {
thumbnailSize: {
height: 176,
width: 312,
},
types: [
"screen",
"window",
],
};
return window.electron.getDesktopCapturerSources(options);
}
export class CallError extends Error { export class CallError extends Error {
code : string; code : string;
@@ -342,9 +357,7 @@ export class MatrixCall extends EventEmitter {
async placeScreenSharingCall( async placeScreenSharingCall(
remoteVideoElement: HTMLVideoElement, remoteVideoElement: HTMLVideoElement,
localVideoElement: HTMLVideoElement, localVideoElement: HTMLVideoElement,
selectDesktopCapturerSource: ( selectDesktopCapturerSource: () => Promise<DesktopCapturerSource>,
sources: Array<DesktopCapturerSource>,
) => Promise<DesktopCapturerSource>,
) { ) {
logger.debug("placeScreenSharingCall"); logger.debug("placeScreenSharingCall");
this.checkForErrorListener(); this.checkForErrorListener();
@@ -355,18 +368,7 @@ export class MatrixCall extends EventEmitter {
// We have access to getDesktopCapturerSources() // We have access to getDesktopCapturerSources()
logger.debug("Electron getDesktopCapturerSources() is available..."); logger.debug("Electron getDesktopCapturerSources() is available...");
try { try {
const getSourcesOptions: GetSourcesOptions = { const selectedSource = await selectDesktopCapturerSource();
thumbnailSize: {
height: 176,
width: 312,
},
types: [
"screen",
"window",
],
};
const sources = await window.electron.getDesktopCapturerSources(getSourcesOptions);
const selectedSource = await selectDesktopCapturerSource(sources);
const getUserMediaOptions: MediaStreamConstraints | DesktopCapturerConstraints = { const getUserMediaOptions: MediaStreamConstraints | DesktopCapturerConstraints = {
audio: false, audio: false,
video: { video: {