From ac69e14fd8de5786fb7b36d446fa506b98aa338d Mon Sep 17 00:00:00 2001 From: HMH Date: Mon, 1 Mar 2021 22:34:23 +0100 Subject: [PATCH] Log some messages if APIs are missing. --- ts/lib.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ts/lib.ts b/ts/lib.ts index a1fc134a..766139de 100644 --- a/ts/lib.ts +++ b/ts/lib.ts @@ -372,7 +372,20 @@ function handle_messages( } } +function check_apis() { + let apis = { + "MediaSource": "This browser doesn't support MSE required to playback video stream, try upgrading!", + "PointerEvent": "This browser doesn't support PointerEvents, input will not work, try upgrading!", + }; + for (let n in apis) { + if (!(n in window)) { + log(LogLevel.ERROR, apis[n]); + } + } +} + function init(access_code: string, websocket_port: number) { + check_apis(); let authed = false; let webSocket = new WebSocket("ws://" + window.location.hostname + ":" + websocket_port);