Skip to content

Commit

Permalink
# add possibility to got parallel video calls
Browse files Browse the repository at this point in the history
  • Loading branch information
ruocogito committed Jun 12, 2024
1 parent 20d14c7 commit b6b67cc
Show file tree
Hide file tree
Showing 17 changed files with 2,460 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ bower_components
build/Release

# Dependency directories
node_modules/
js/node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
Expand Down
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/matrix-demo-client.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<html>
<head>
<title>VoIP Test</title>
<!-- <script type="text/javascript" src="js/lib/olm.js"></script> -->
<script type="text/javascript" src="js/lib/bundle.js"></script>
<script type="text/javascript" src="js/voip.js"></script>
</head>

<body>
You can place and receive calls with this example. Make sure to edit the constants in
<code>browserTest.js</code> first.
<div id="config"></div>
<div id="result"></div>
<div>
<label for="username">Username: </label>
<select id="username" name="username" required>
<option value="user">user</option>
<option value="user1">user1</option>
<option value="mhalane">mhalane</option>
<option value="mhalane">registr</option>
<option value="mhalane">igrin</option>
</select>
<button id="connect">Connect</button>
<label id="myComboBoxLabel" for="myComboBox" style="display:none">Room: </label>
<select id="myComboBox" onchange="comboBoxChanged()" style="display:none">
</select>
</div>
<br>
<button id="call">Place Call</button>
<button id="answer">Answer Call</button>
<button id="hangup">Hangup Call</button>
<button id="toggle_camera">Toggle camera</button>
<div style="margin-top:5mm;"><button id="join_conference" onclick="onJoinGroupCall()">Join Conference</button><button id="remove_group_call">Remove GroupCall</button></div>
<div id="videoBackground" class="video-background">
</div>
</body>
</html>

<style>
.video-background {
width: 100%;
height: 100%;
display: flex;
flex-direction: row;
justify-content: start;
}

.video-element {
width: 300px;
height: 300px;
}
</style>
20 changes: 20 additions & 0 deletions js/bundle-builder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//global.matrixSdkCrypto = await import("@matrix-org/matrix-sdk-crypto-wasm");
global.crypto2 = require('crypto');
global.Olm = require('@matrix-org/olm');
// const path = require('path');
//const olm = require('olm');
//global.Olm = olm;
//global.wasmData = await import('./node_modules/@matrix-org/olm/olm.wasm');

//global.wasmPath = "/js/node_modules/olm/olm.wasm" //path.resolve(__dirname, 'olm.wasm');

import * as sdk from "matrix-js-sdk";

// Enable encryption by importing and initializing libolm

const util = require('util');

global.inspect = util.inspect



20 changes: 20 additions & 0 deletions js/lib/bundle.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/

/*!
* content-type
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/

/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */

/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */

// @license-end
3 changes: 3 additions & 0 deletions js/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd /d "%~dp0"
rem cd "J:\web-projects\matrix-demo-client\matrix-demo-client\js"
start npx webpack
24 changes: 24 additions & 0 deletions js/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"dependencies": {
"@matrix-org/olm": "https://gitlab.matrix.org/matrix-org/olm/-/package_files/2572/download",
"buffer": "^6.0.3",
"crypto": "^1.0.1",
"crypto-browserify": "^3.12.0",
"dotenv-webpack": "^8.0.1",
"file-loader": "^6.2.0",
"fs": "^0.0.1-security",
"fs.js": "^0.0.1",
"matrix-js-sdk": "^30.0.1",
"path-browserify": "^1.0.1",
"process": "^0.11.10",
"stream": "^0.0.2",
"util": "^0.12.5",
"vm-browserify": "^1.1.2"
},
"devDependencies": {
"file": "^0.2.2",
"system": "^2.0.1",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4"
}
}
Loading

0 comments on commit b6b67cc

Please sign in to comment.