still-alive/assets/js/script.mjs
Victor Westerlund 3ef9e82d79 Added functional code before manifest and CSS
The JS-part of this demo is now functional to the point where a Monkeydo manifest can be played on the different windows. CSS styling and an actual manifest will still have to be created.
2021-10-18 13:14:39 +02:00

16 lines
No EOL
502 B
JavaScript
Executable file

import { default as Player } from "./modules/PlayerManager.mjs";
const play = document.getElementById("play");
const message = document.getElementById("message");
try {
if(typeof BroadcastChannel !== "function") {
throw new Error("BroadcastChannel API is not supported");
}
const player = new Player();
play.addEventListener("click",() => player.play());
} catch(error) {
play.classList.add("unsupported");
play.innerText = "Your browser can not play this demo";
message.innerText = error;
}