aboutsummaryrefslogtreecommitdiff
path: root/source/client/index.ts
diff options
context:
space:
mode:
authorMetaMuffin <metamuffin@yandex.com>2021-08-05 11:00:46 +0200
committerMetaMuffin <metamuffin@yandex.com>2021-08-05 11:00:46 +0200
commit4475fb02925c04ba19cb9ec8b99110e4e74c3acb (patch)
tree85df7f1e46ccf7abdc80303b88d57779c0f40008 /source/client/index.ts
parenta8d6fa97be777ab08f09252dc4864ba241b17687 (diff)
downloadkeks-meet-4475fb02925c04ba19cb9ec8b99110e4e74c3acb.tar
keks-meet-4475fb02925c04ba19cb9ec8b99110e4e74c3acb.tar.bz2
keks-meet-4475fb02925c04ba19cb9ec8b99110e4e74c3acb.tar.zst
updated licence, added all the code
Diffstat (limited to 'source/client/index.ts')
-rw-r--r--source/client/index.ts16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/client/index.ts b/source/client/index.ts
index 87421f2..31c8b1f 100644
--- a/source/client/index.ts
+++ b/source/client/index.ts
@@ -1,3 +1,4 @@
+import { log } from "./logger"
import { Room } from "./room"
export const servers = {
@@ -13,7 +14,13 @@ export interface User {
export const users: Map<string, User> = new Map()
-window.onload = async () => {
+window.onload = () => main()
+
+export var local_media: MediaStream
+
+
+export async function main() {
+ await init_local_media()
if (window.location.pathname.startsWith("/room/")) {
const room_name = window.location.pathname.substr("/room/".length)
let room = new Room(room_name)
@@ -23,6 +30,13 @@ window.onload = async () => {
}
}
+export async function init_local_media() {
+ log("media", "requesting user media")
+ local_media = await navigator.mediaDevices.getUserMedia({ audio: true, video: true })
+ log("media", `got ${local_media.getTracks().length} local streams"`, local_media.getTracks())
+}
+
+
// async function setup_webrtc() {