Skip to content

Commit

Permalink
Log some messages if APIs are missing.
Browse files Browse the repository at this point in the history
  • Loading branch information
H-M-H committed Mar 1, 2021
1 parent b3787bb commit ac69e14
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ts/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ac69e14

Please sign in to comment.