You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
@@ -371,7 +371,7 @@ export class MatrixCall extends EventEmitter {
|
|||||||
|
|
||||||
if (window.desktopCapturer) {
|
if (window.desktopCapturer) {
|
||||||
// We have access to the Electron desktop capturer
|
// We have access to the Electron desktop capturer
|
||||||
logger.debug("Electron desktopCapturer is available");
|
logger.debug("Electron desktopCapturer is available...");
|
||||||
try {
|
try {
|
||||||
const options: ElectronGetSourcesOptions = {
|
const options: ElectronGetSourcesOptions = {
|
||||||
thumbnailSize: {
|
thumbnailSize: {
|
||||||
@@ -384,11 +384,9 @@ export class MatrixCall extends EventEmitter {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
window.desktopCapturer.getSources(options).then((sources: Array<ElectronDesktopCapturerSource>) => {
|
const sources = await window.desktopCapturer.getSources(options);
|
||||||
console.log("Sources:", sources);
|
const selectedSource = await selectDesktopCapturerSource(sources);
|
||||||
selectDesktopCapturerSource(sources).then((selectedSource)=> {
|
this.screenSharingStream = await window.navigator.mediaDevices.getUserMedia({
|
||||||
console.log("Source:", selectedSource);
|
|
||||||
window.navigator.mediaDevices.getUserMedia({
|
|
||||||
audio: false,
|
audio: false,
|
||||||
video: {
|
video: {
|
||||||
mandatory: {
|
mandatory: {
|
||||||
@@ -396,20 +394,10 @@ export class MatrixCall extends EventEmitter {
|
|||||||
chromeMediaSourceId: selectedSource.id,
|
chromeMediaSourceId: selectedSource.id,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}).then((stream)=> {
|
});
|
||||||
this.screenSharingStream = stream;
|
|
||||||
console.log("Stream", this.screenSharingStream);
|
|
||||||
logger.debug("Got screen stream, requesting audio stream...");
|
logger.debug("Got screen stream, requesting audio stream...");
|
||||||
|
|
||||||
const audioConstraints = getUserMediaVideoContraints(CallType.Voice);
|
const audioConstraints = getUserMediaVideoContraints(CallType.Voice);
|
||||||
this.placeCallWithConstraints(audioConstraints);
|
this.placeCallWithConstraints(audioConstraints);
|
||||||
}).catch( (error) => {
|
|
||||||
this.emit(error);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}).catch((error) => {
|
|
||||||
this.emit(error);
|
|
||||||
});
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.emit(CallEvent.Error,
|
this.emit(CallEvent.Error,
|
||||||
new CallError(
|
new CallError(
|
||||||
@@ -421,7 +409,7 @@ export class MatrixCall extends EventEmitter {
|
|||||||
} else {
|
} else {
|
||||||
/* We do not have access to the Electron desktop capturer,
|
/* We do not have access to the Electron desktop capturer,
|
||||||
* therefore we can assume we are on the web */
|
* therefore we can assume we are on the web */
|
||||||
logger.debug("Electron desktopCapturer is not available");
|
logger.debug("Electron desktopCapturer is not available...");
|
||||||
try {
|
try {
|
||||||
this.screenSharingStream = await navigator.mediaDevices.getDisplayMedia({'audio': false});
|
this.screenSharingStream = await navigator.mediaDevices.getDisplayMedia({'audio': false});
|
||||||
logger.debug("Got screen stream, requesting audio stream...");
|
logger.debug("Got screen stream, requesting audio stream...");
|
||||||
|
|||||||
Reference in New Issue
Block a user