mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 04:21:57 +03:00
Merge pull request #608 from matrix-org/dbkr/move_screen_sharing_error
Move screen sharing error check into platform
This commit is contained in:
commit
e95f5b959f
2 changed files with 21 additions and 0 deletions
|
@ -73,4 +73,13 @@ export default class BasePlatform {
|
|||
getAppVersion() {
|
||||
throw new Error("getAppVersion not implemented!");
|
||||
}
|
||||
|
||||
/*
|
||||
* If it's not expected that capturing the screen will work
|
||||
* with getUserMedia, return a string explaining why not.
|
||||
* Otherwise, return null.
|
||||
*/
|
||||
screenCaptureErrorString() {
|
||||
return "Not implemented";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
var MatrixClientPeg = require('./MatrixClientPeg');
|
||||
var PlatformPeg = require("./PlatformPeg");
|
||||
var Modal = require('./Modal');
|
||||
var sdk = require('./index');
|
||||
var Matrix = require("matrix-js-sdk");
|
||||
|
@ -187,6 +188,17 @@ function _onAction(payload) {
|
|||
);
|
||||
}
|
||||
else if (payload.type === 'screensharing') {
|
||||
const screenCapErrorString = PlatformPeg.get().screenCaptureErrorString();
|
||||
if (screenCapErrorString) {
|
||||
_setCallState(undefined, newCall.roomId, "ended");
|
||||
console.log("Can't capture screen: " + screenCapErrorString);
|
||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Unable to capture screen",
|
||||
description: screenCapErrorString
|
||||
});
|
||||
return;
|
||||
}
|
||||
newCall.placeScreenSharingCall(
|
||||
payload.remote_element,
|
||||
payload.local_element
|
||||
|
|
Loading…
Reference in a new issue