-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
47 lines (45 loc) · 1.34 KB
/
Copy pathtest.html
File metadata and controls
47 lines (45 loc) · 1.34 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!doctype html>
<html>
<head>
<title>@konsumer/nuked</title>
<style>
body {
font-family: monospace;
color: white;
background: black;
margin: auto;
max-width: 90vw;
}
a {
color: inherit;
}
</style>
<script type="importmap">
{
"imports": {
"@konsumer/nuked": "https://esm.run/@konsumer/nuked",
"@konsumer/nuked/nuked-player": "https://esm.run/@konsumer/nuked/nuked-player",
"pako": "https://esm.run/pako"
}
}
</script>
<script type="module">
// this registers the web-component
import '@konsumer/nuked/nuked-player'
</script>
</head>
<body>
<p>This is used to test various things, like the CDN:</p>
<nuked-player src="demos/break_my_heart.imf"></nuked-player>
<p>Here is a player made with just the wav:</p>
<script type="module">
import { createWave, imf } from '@konsumer/nuked'
const queue = imf(await fetch('demos/break_my_heart.imf').then((r) => r.arrayBuffer()))
const wav = await createWave(queue)
const audioElement = document.createElement('audio')
audioElement.controls = true
audioElement.src = URL.createObjectURL(new Blob([wav], { type: 'audio/wav' }))
document.body.appendChild(audioElement)
</script>
</body>
</html>