-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12780 from vector-im/travis/wrapped-jitsi
Use a local widget wrapper for Jitsi calls
- Loading branch information
Showing
8 changed files
with
308 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
Copyright 2020 New Vector Ltd | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
import ElectronPlatform from './platform/ElectronPlatform'; | ||
import WebPlatform from './platform/WebPlatform'; | ||
import PlatformPeg from 'matrix-react-sdk/src/PlatformPeg'; | ||
import SdkConfig from "matrix-react-sdk/src/SdkConfig"; | ||
|
||
export function preparePlatform() { | ||
if ((<any>window).ipcRenderer) { | ||
console.log("Using Electron platform"); | ||
const plaf = new ElectronPlatform(); | ||
PlatformPeg.set(plaf); | ||
} else { | ||
console.log("Using Web platform"); | ||
PlatformPeg.set(new WebPlatform()); | ||
} | ||
} | ||
|
||
export async function loadConfig(): Promise<{configError?: Error, configSyntaxError: boolean}> { | ||
const platform = PlatformPeg.get(); | ||
|
||
let configJson; | ||
let configError; | ||
let configSyntaxError = false; | ||
try { | ||
configJson = await platform.getConfig(); | ||
} catch (e) { | ||
configError = e; | ||
|
||
if (e && e.err && e.err instanceof SyntaxError) { | ||
console.error("SyntaxError loading config:", e); | ||
configSyntaxError = true; | ||
configJson = {}; // to prevent errors between here and loading CSS for the error box | ||
} | ||
} | ||
|
||
// XXX: We call this twice, once here and once in MatrixChat as a prop. We call it here to ensure | ||
// granular settings are loaded correctly and to avoid duplicating the override logic for the theme. | ||
// | ||
// Note: this isn't called twice for some wrappers, like the Jitsi wrapper. | ||
SdkConfig.put(configJson); | ||
|
||
return {configError, configSyntaxError}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Jitsi Widget</title> | ||
</head> | ||
<body> | ||
<div id="jitsiContainer"><!-- the js will put the conference here --></div> | ||
<div id="joinButtonContainer"> | ||
<div class="joinConferenceFloating"> | ||
<div class="joinConferencePrompt"> | ||
<!-- TODO: i18n --> | ||
<h2>Jitsi Video Conference</h2> | ||
<button type="button" id="joinButton">Join Conference</button> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
Copyright 2020 New Vector Ltd. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// TODO: Match the user's theme: https://github.com/vector-im/riot-web/issues/12794 | ||
|
||
@font-face { | ||
font-family: 'Nunito'; | ||
font-style: normal; | ||
font-weight: 400; | ||
src: url('~matrix-react-sdk/res/fonts/Nunito/Nunito-Regular.ttf') format('truetype'); | ||
} | ||
|
||
body { | ||
font-family: Nunito, Arial, Helvetica, sans-serif; | ||
background-color: #181b21; | ||
color: #edf3ff; | ||
} | ||
|
||
body, html { | ||
padding: 0; | ||
margin: 0; | ||
} | ||
|
||
#jitsiContainer { | ||
position: fixed; | ||
top: 0; | ||
bottom: 0; | ||
left: 0; | ||
right: 0; | ||
} | ||
|
||
#joinButtonContainer { | ||
display: table; | ||
position: absolute; | ||
height: 100%; | ||
width: 100%; | ||
} | ||
|
||
.joinConferenceFloating { | ||
display: table-cell; | ||
vertical-align: middle; | ||
} | ||
|
||
.joinConferencePrompt { | ||
margin-left: auto; | ||
margin-right: auto; | ||
width: 90%; | ||
text-align: center; | ||
} | ||
|
||
#joinButton { | ||
// A mix of AccessibleButton styles | ||
cursor: pointer; | ||
padding: 7px 18px; | ||
text-align: center; | ||
border-radius: 4px; | ||
display: inline-block; | ||
font-size: 14px; | ||
color: #ffffff; | ||
background-color: #03b381; | ||
border: 0; | ||
} |
Oops, something went wrong.