mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 13:14:58 +08:00
Move screen sharing error check into platform
Because on the browser it depends on HTTPS, on electron it doesn't matter.
This commit is contained in:
parent
085f134e84
commit
a16aae1124
@ -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,12 @@ 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);
|
||||
return;
|
||||
}
|
||||
newCall.placeScreenSharingCall(
|
||||
payload.remote_element,
|
||||
payload.local_element
|
||||
|
Loading…
Reference in New Issue
Block a user