feat(alwaysontop):Implement

This commit is contained in:
hristoterezov 2017-07-14 16:24:30 -05:00
parent 4dd37fb949
commit aac7c92b39
4 changed files with 28 additions and 39 deletions

View file

@ -3,8 +3,7 @@ Jitsi Meet Electron
Electron application for [Jitsi Meet](https://github.com/jitsi/jitsi-meet). Electron application for [Jitsi Meet](https://github.com/jitsi/jitsi-meet).
## Configuration ## Configuration
You can change the Jitsi Meet deployment url with the jitsiMeetURL property You can change the Jitsi Meet deployment domain with the jitsiMeetDomain property from config.js
from config.js
## Building the sources ## Building the sources
```bash ```bash

View file

@ -1,6 +1,6 @@
module.exports = { module.exports = {
/** /**
* The URL of the Jitsi Meet deployment that will be used. * The domain of the Jitsi Meet deployment that will be used.
*/ */
jitsiMeetURL: "https://meet.jit.si/" jitsiMeetDomain: "meet.jit.si"
}; };

View file

@ -10,11 +10,6 @@
body { body {
-webkit-app-region: drag -webkit-app-region: drag
} }
iframe {
width: 100%;
height: 100%;
border: 0 none;
}
</style> </style>
</head> </head>
<body> <body>

View file

@ -1,40 +1,35 @@
/* global process */ /* global process, JitsiMeetExternalAPI */
const utils = require("jitsi-meet-electron-utils");
const { const {
RemoteControl, RemoteControl,
setupScreenSharingForWindow setupScreenSharingForWindow
} = utils; } = require("jitsi-meet-electron-utils");
const config = require("../../config.js"); const { jitsiMeetDomain } = require("../../config.js");
/** /**
* The remote control instance. * Loads a script from a specific source.
*
* @param src the source from the which the script is to be (down)loaded
* @param loadCallback on load callback function
* @param errorCallback callback to be called on error loading the script
*/ */
let remoteControl; function loadScript(
src,
loadCallback = () => {},
errorCallback = console.error) {
const script = document.createElement('script');
/** script.async = true;
* Cteates the iframe that will load Jitsi Meet.
*/
let iframe = document.createElement('iframe');
iframe.src = process.env.JITSI_MEET_URL || config.jitsiMeetURL;
iframe.allowFullscreen = true;
iframe.onload = onload;
document.body.appendChild(iframe);
/** script.onload = loadCallback;
* Handles loaded event for iframe: script.onerror = errorCallback;
* Enables screen sharing functionality to the iframe webpage. script.src = src;
* Initializes postis. document.head.appendChild(script);
* Initializes remote control.
*/
function onload() {
setupScreenSharingForWindow(iframe.contentWindow);
iframe.contentWindow.onunload = onunload;
remoteControl = new RemoteControl(iframe);
} }
/** loadScript(`https://${jitsiMeetDomain}/external_api.js`, () => {
* Clears the postis objects and remoteControl. const api = new JitsiMeetExternalAPI(
*/ process.env.JITSI_MEET_DOMAIN || jitsiMeetDomain);
function onunload() { const iframe = api.getIFrame();
remoteControl.dispose(); setupScreenSharingForWindow(iframe);
} new RemoteControl(iframe);
});