From 6b5e64510395c4476a3c27a9db015135e50cf878 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 16 Sep 2022 21:32:09 +0200 Subject: optional streams (5, minor fixes; done) --- client-web/source/chat.ts | 2 ++ client-web/source/keybinds.ts | 3 ++- client-web/source/preferences/ui.ts | 2 ++ client-web/source/resource/mod.ts | 2 ++ client-web/source/resource/track.ts | 8 ++++++-- client-web/source/user/local.ts | 11 ----------- 6 files changed, 14 insertions(+), 14 deletions(-) (limited to 'client-web/source') diff --git a/client-web/source/chat.ts b/client-web/source/chat.ts index d6aeb00..67622d4 100644 --- a/client-web/source/chat.ts +++ b/client-web/source/chat.ts @@ -1,3 +1,5 @@ +/// + import { ChatMessage } from "../../common/packets.d.ts"; import { ediv, espan, image_view, notify, OverlayUi } from "./helper.ts"; import { log } from "./logger.ts"; diff --git a/client-web/source/keybinds.ts b/client-web/source/keybinds.ts index 028e119..fba0047 100644 --- a/client-web/source/keybinds.ts +++ b/client-web/source/keybinds.ts @@ -1,5 +1,6 @@ -import { Room } from "./room.ts" +/// +import { Room } from "./room.ts" export function setup_keybinds(room: Room) { let command_mode = false diff --git a/client-web/source/preferences/ui.ts b/client-web/source/preferences/ui.ts index 634d945..f07996f 100644 --- a/client-web/source/preferences/ui.ts +++ b/client-web/source/preferences/ui.ts @@ -1,3 +1,5 @@ +/// + import { ebr, ebutton, ediv, elabel, espan, etd, etr, OverlayUi } from "../helper.ts"; import { PREF_DECLS } from "./decl.ts"; import { change_pref, on_pref_changed, PrefDecl, PREFS } from "./mod.ts"; diff --git a/client-web/source/resource/mod.ts b/client-web/source/resource/mod.ts index 9583604..50bc91c 100644 --- a/client-web/source/resource/mod.ts +++ b/client-web/source/resource/mod.ts @@ -1,3 +1,5 @@ +/// + import { ProvideInfo } from "../../../common/packets.d.ts" import { ediv } from "../helper.ts" import { log } from "../logger.ts" diff --git a/client-web/source/resource/track.ts b/client-web/source/resource/track.ts index bc26acc..b2f73ab 100644 --- a/client-web/source/resource/track.ts +++ b/client-web/source/resource/track.ts @@ -1,3 +1,5 @@ +/// + import { ProvideInfo } from "../../../common/packets.d.ts"; import { ebutton } from "../helper.ts"; import { TrackHandle } from "../track_handle.ts"; @@ -29,8 +31,10 @@ export class TrackResource extends Resource { super.destroy() } + // TODO --- all the following code could be more generic and prettier in the UI --- + create_preview(): HTMLElement { - return ebutton("Enable", { + return ebutton(`Enable ${this.info.kind}`, { onclick: (e) => { (e as HTMLButtonElement).disabled = true; this.request() @@ -40,7 +44,7 @@ export class TrackResource extends Resource { create_element() { if (!this.track) { return this.create_preview() } const el = document.createElement("div") - el.append(ebutton("Disable", { + el.append(ebutton(`Enable ${this.info.kind}`, { onclick: (e) => { (e as HTMLButtonElement).disabled = true; this.request_stop() diff --git a/client-web/source/user/local.ts b/client-web/source/user/local.ts index 571295d..49f0099 100644 --- a/client-web/source/user/local.ts +++ b/client-web/source/user/local.ts @@ -78,17 +78,6 @@ export class LocalUser extends User { } } - // send_track(t: TrackHandle) { - // this.room.remote_users.forEach(u => u.peer.addTrack(t.track)) - // t.addEventListener("ended", () => { - // this.room.remote_users.forEach(u => { - // u.peer.getSenders().forEach(s => { - // if (s.track == t.track) u.peer.removeTrack(s) - // }) - // }) - // }) - // } - async create_camera_res() { log("media", "requesting user media (camera)") const user_media = await window.navigator.mediaDevices.getUserMedia({ -- cgit v1.2.3-70-g09d2