-
Notifications
You must be signed in to change notification settings - Fork 2
/
player.html
33 lines (33 loc) · 1.21 KB
/
player.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf8">
<title>GLEAM</title>
<link rel="stylesheet" type="text/css" href="css/player.css">
</head>
<body class="gleam-body">
<script type="module">
// FIXME give a real api for this. question is, how do i inject into the editor AND the player
import {
RemoteAssetLibrary,
Script,
Player,
} from "./build/gleam-player.js";
window.addEventListener('load', ev => {
let root_url = new URL('https://apps.veekun.com/flora-cutscenes/res/prompt2-itchyitchy-final/');
root_url = new URL('/res/circlet-of-the-sun/', window.location);
let library = new RemoteAssetLibrary(root_url);
let xhr = new XMLHttpRequest;
xhr.addEventListener('load', ev => {
// FIXME handle errors yadda yadda
let script = Script.from_json(JSON.parse(xhr.responseText));
let player = new Player(script, library);
player.inject(document.body);
});
// XXX lol
xhr.open('GET', new URL('gleam-script.json', root_url));
xhr.send();
});
</script>
</body>
</html>