Merge pull request #1355 from matrix-org/rob/electron-screensharing
Add support for Jitsi screensharing in electron app
This commit is contained in:
commit
79af97011c
2 changed files with 28 additions and 0 deletions
|
@ -107,6 +107,9 @@ export default class BasePlatform {
|
||||||
|
|
||||||
isElectron(): boolean { return false; }
|
isElectron(): boolean { return false; }
|
||||||
|
|
||||||
|
setupScreenSharingForIframe() {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Restarts the application, without neccessarily reloading
|
* Restarts the application, without neccessarily reloading
|
||||||
* any application code
|
* any application code
|
||||||
|
|
|
@ -19,6 +19,7 @@ limitations under the License.
|
||||||
import url from 'url';
|
import url from 'url';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import MatrixClientPeg from '../../../MatrixClientPeg';
|
import MatrixClientPeg from '../../../MatrixClientPeg';
|
||||||
|
import PlatformPeg from '../../../PlatformPeg';
|
||||||
import ScalarAuthClient from '../../../ScalarAuthClient';
|
import ScalarAuthClient from '../../../ScalarAuthClient';
|
||||||
import SdkConfig from '../../../SdkConfig';
|
import SdkConfig from '../../../SdkConfig';
|
||||||
import Modal from '../../../Modal';
|
import Modal from '../../../Modal';
|
||||||
|
@ -127,6 +128,30 @@ export default React.createClass({
|
||||||
loading: false,
|
loading: false,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
window.addEventListener('message', this._onMessage, false);
|
||||||
|
},
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
window.removeEventListener('message', this._onMessage);
|
||||||
|
},
|
||||||
|
|
||||||
|
_onMessage(event) {
|
||||||
|
if (this.props.type !== 'jitsi') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!event.origin) {
|
||||||
|
event.origin = event.originalEvent.origin;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.state.widgetUrl.startsWith(event.origin)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.data.widgetAction === 'jitsi_iframe_loaded') {
|
||||||
|
const iframe = this.refs.appFrame.contentWindow
|
||||||
|
.document.querySelector('iframe[id^="jitsiConferenceFrame"]');
|
||||||
|
PlatformPeg.get().setupScreenSharingForIframe(iframe);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_canUserModify: function() {
|
_canUserModify: function() {
|
||||||
|
|
Loading…
Reference in a new issue