spin now works on ios
This commit is contained in:
parent
b639656b2f
commit
0756c34195
3 changed files with 3 additions and 8 deletions
|
@ -59,13 +59,14 @@
|
||||||
|
|
||||||
button {
|
button {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<canvas></canvas>
|
<canvas></canvas>
|
||||||
<img src="/images/ui/rock.png" id="rock">
|
<img src="/images/ui/rock.png" id="rock">
|
||||||
<audio hidden loop id="audio"><source src="/audio/rockspin.ogg" type="audio/mp3"></audio>
|
<audio autoplay loop id="audio" preload="auto"><source src="/audio/rockspin.wav" type="audio/wav"></audio>
|
||||||
<button id="b" onclick="a.play(); this.style.display = 'none'">Autoplay is disabled! Click here to play audio.</button>
|
<button id="b" onclick="a.play(); this.style.display = 'none'">Autoplay is disabled! Click here to play audio.</button>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -74,13 +75,7 @@
|
||||||
|
|
||||||
var p = a.play();
|
var p = a.play();
|
||||||
|
|
||||||
if (p !== undefined) {
|
p.catch(function() {b.style.display = "block"});
|
||||||
p.then(_ => {
|
|
||||||
b.style.display = 'none';
|
|
||||||
}).catch(error => {
|
|
||||||
b.style.display = 'auto';
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
BIN
site/audio/rockspin.mp3
Normal file
BIN
site/audio/rockspin.mp3
Normal file
Binary file not shown.
BIN
site/audio/rockspin.wav
Normal file
BIN
site/audio/rockspin.wav
Normal file
Binary file not shown.
Loading…
Reference in a new issue