2025-02-11 23:04:28 +01:00
|
|
|
const api = new API(API_URL);
|
|
|
|
|
|
|
|
const root = document.getElementById("root");
|
|
|
|
|
|
|
|
async function init() {
|
|
|
|
let query = new URLSearchParams(document.location.search);
|
|
|
|
|
2025-02-17 23:04:50 +01:00
|
|
|
let video;
|
|
|
|
try {
|
|
|
|
video = await api.getVideo(query.get("id"));
|
|
|
|
} catch (e) {
|
|
|
|
showError(e);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
root.appendChild(await components.player(video));
|
2025-02-11 23:04:28 +01:00
|
|
|
|
2025-02-12 23:40:37 +01:00
|
|
|
finishedLoading();
|
2025-02-11 23:04:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
init();
|