-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.audio.hls.html
41 lines (37 loc) · 1.04 KB
/
index.audio.hls.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
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html>
<head>
<title>Saturn Examples</title>
<link rel="stylesheet" href="styles.css">
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
</head>
<body>
<div class="background">
<header class="header">
<div class="logo">
<div class="logo"></div>
</div>
</header>
<div class="audio-container">
<audio id="audio1" controls preload="auto" autoplay></audio>
</div>
</div>
<script>
var audio1 = document.getElementById('audio1');
// First Audio
if (Hls.isSupported()) {
var hls1 = new Hls();
hls1.loadSource('/ipfs/QmdjRK1qVDkttMTkpzxXXF349dbV4xUAxrRqQXDq4XhD9A/index.m3u8');
hls1.attachMedia(audio1);
hls1.on(Hls.Events.MANIFEST_PARSED, function () {
audio1.play();
});
}
// For browsers that natively support HLS
else if (audio1.canPlayType('application/vnd.apple.mpegURL')) {
audio1.src = '/ipfs/QmdjRK1qVDkttMTkpzxXXF349dbV4xUAxrRqQXDq4XhD9A/index.m3u8';
audio1.play();
}
</script>
</body>
</html>