summaryrefslogtreecommitdiff
path: root/client-web
diff options
context:
space:
mode:
Diffstat (limited to 'client-web')
-rw-r--r--client-web/public/app.html3
-rw-r--r--client-web/public/assets/rnnoise/rnnoise-processor.js4
-rw-r--r--client-web/public/start.html4
-rw-r--r--client-web/source/index.ts3
-rw-r--r--client-web/source/local_user.ts2
-rw-r--r--client-web/source/room.ts19
-rw-r--r--client-web/source/user.ts2
7 files changed, 16 insertions, 21 deletions
diff --git a/client-web/public/app.html b/client-web/public/app.html
index 693e9a2..beee565 100644
--- a/client-web/public/app.html
+++ b/client-web/public/app.html
@@ -3,13 +3,10 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
-
<script defer async type="module" src="/assets/bundle.js"></script>
<link rel="stylesheet" href="/assets/style/master.css" />
-
<title>keks-meet</title>
</head>
-
<body>
<p>
keks-meet needs evil javascript to be enabled. Don't be afraid
diff --git a/client-web/public/assets/rnnoise/rnnoise-processor.js b/client-web/public/assets/rnnoise/rnnoise-processor.js
index 5b594a4..72cf736 100644
--- a/client-web/public/assets/rnnoise/rnnoise-processor.js
+++ b/client-web/public/assets/rnnoise/rnnoise-processor.js
@@ -25,14 +25,14 @@
: ((this.alive = !1), b.deleteState(this.state)));
};
}
- process(a, c, e) {
+ process(a, c, _e) {
if (!a[0][0]) return 1
if (this.alive)
return (
d.set(a[0][0], b.getInput(this.state) / 4),
(a = c[0][0]),
(c = b.pipe(this.state, a.length) / 4) &&
- a.set(d.subarray(c, c + a.length)),
+ a.set(d.subarray(c, c + a.length)),
!0
);
}
diff --git a/client-web/public/start.html b/client-web/public/start.html
index db62bcf..1a8080e 100644
--- a/client-web/public/start.html
+++ b/client-web/public/start.html
@@ -3,9 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
-
- <link rel="stylesheet" href="/_assets/style/master.css" />
-
+ <link rel="stylesheet" href="/assets/style/master.css" />
<title>keks-meet</title>
</head>
diff --git a/client-web/source/index.ts b/client-web/source/index.ts
index 5695573..22b2baf 100644
--- a/client-web/source/index.ts
+++ b/client-web/source/index.ts
@@ -21,7 +21,8 @@ window.onload = () => main()
export async function main() {
document.body.querySelectorAll("p").forEach(e => e.remove())
log("*", "starting up")
- const room_name = window.location.pathname.substring("/".length)
+ const room_name = window.location.hash.substring(1)
+ if (room_name.length == 0) window.location.href = "/" // send them back to the start page
const conn = await (new SignalingConnection().connect(room_name))
const room = new Room(conn)
create_menu()
diff --git a/client-web/source/local_user.ts b/client-web/source/local_user.ts
index efedfc2..02d8da1 100644
--- a/client-web/source/local_user.ts
+++ b/client-web/source/local_user.ts
@@ -18,7 +18,7 @@ export class LocalUser extends User {
this.local = true
this.create_controls()
this.add_initial_tracks()
- log("usermodel", `added local user: ${this.name}`)
+ log("usermodel", `added local user: ${this.display_name}`)
}
async add_initial_tracks() {
diff --git a/client-web/source/room.ts b/client-web/source/room.ts
index 9f27230..961478e 100644
--- a/client-web/source/room.ts
+++ b/client-web/source/room.ts
@@ -6,19 +6,19 @@ import { User } from "./user.ts";
import { LocalUser } from "./local_user.ts";
import { ClientboundPacket, RelayMessage } from "../../common/packets.d.ts";
import { SignalingConnection } from "./protocol/mod.ts";
+import { ediv } from "./helper.ts";
export class Room {
- el: HTMLElement
- users: Map<number, User> = new Map()
- remote_users: Map<number, RemoteUser> = new Map()
- local_user!: LocalUser
- my_id!: number
+ public el: HTMLElement = ediv({ classes: ["room"] })
+ public users: Map<number, User> = new Map()
+ public remote_users: Map<number, RemoteUser> = new Map()
+ public local_user!: LocalUser
+ public my_id!: number
constructor(public signaling: SignalingConnection) {
- this.el = document.createElement("div")
- this.el.classList.add("room")
- this.signaling.control_handler = this.control_handler
- this.signaling.relay_handler = this.relay_handler
+ this.signaling.control_handler = (a) => this.control_handler(a)
+ this.signaling.relay_handler = (a, b) => this.relay_handler(a, b)
+ console.log("room", this.el)
}
control_handler(packet: ClientboundPacket) {
@@ -46,7 +46,6 @@ export class Room {
this.remote_users.get(p.id)!.leave()
this.users.delete(p.id)
this.remote_users.delete(p.id)
- return
}
}
diff --git a/client-web/source/user.ts b/client-web/source/user.ts
index 057cdf4..0bdf250 100644
--- a/client-web/source/user.ts
+++ b/client-web/source/user.ts
@@ -11,7 +11,7 @@ export abstract class User {
public name?: string
protected tracks: Set<TrackHandle> = new Set()
- constructor(public room: Room, public id: number,) {
+ constructor(public room: Room, public id: number) {
this.el = document.createElement("div")
this.el.classList.add("user")
this.room.el.append(this.el)