diff options
author | MetaMuffin <metamuffin@yandex.com> | 2021-08-05 11:00:46 +0200 |
---|---|---|
committer | MetaMuffin <metamuffin@yandex.com> | 2021-08-05 11:00:46 +0200 |
commit | 4475fb02925c04ba19cb9ec8b99110e4e74c3acb (patch) | |
tree | 85df7f1e46ccf7abdc80303b88d57779c0f40008 /source/client/index.ts | |
parent | a8d6fa97be777ab08f09252dc4864ba241b17687 (diff) | |
download | keks-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.ts | 16 |
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() { |