still-alive/assets/js/script.mjs
Victor Westerlund 601c7d3dd2 Unsynced working example
Everything is cued up and good to go. Now comes the fun part of syncing the lyrics with the song
2021-10-30 13:30:15 +02:00

21 lines
No EOL
581 B
JavaScript
Executable file

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