mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-10 07:18:26 +01:00
gwa gwa
This commit is contained in:
parent
0b48788174
commit
5dd37cc23e
1 changed files with 5 additions and 4 deletions
|
@ -984,8 +984,9 @@ function cstsRemaining(totalTimeInSeconds, elapsedTimeInSeconds) {
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
|
const audi = document.getElementById("aud");
|
||||||
const audioContext = new (window.AudioContext || window.webkitAudioContext)();
|
const audioContext = new (window.AudioContext || window.webkitAudioContext)();
|
||||||
const source = audioContext.createMediaElementSource(aud);
|
const source = audioContext.createMediaElementSource(audi);
|
||||||
const analyser = audioContext.createAnalyser();
|
const analyser = audioContext.createAnalyser();
|
||||||
|
|
||||||
source.connect(analyser);
|
source.connect(analyser);
|
||||||
|
@ -1004,7 +1005,7 @@ function checkAudio() {
|
||||||
if (video.ended || video.paused || quality === 'medium') return;
|
if (video.ended || video.paused || quality === 'medium') return;
|
||||||
|
|
||||||
// Check if the audio volume is greater than 0
|
// Check if the audio volume is greater than 0
|
||||||
if (aud.volume === 0) return;
|
if (audi.volume === 0) return;
|
||||||
|
|
||||||
const bufferLength = analyser.fftSize;
|
const bufferLength = analyser.fftSize;
|
||||||
const dataArray = new Uint8Array(bufferLength);
|
const dataArray = new Uint8Array(bufferLength);
|
||||||
|
@ -1015,8 +1016,8 @@ function checkAudio() {
|
||||||
|
|
||||||
if (!isAudioPlaying) {
|
if (!isAudioPlaying) {
|
||||||
// Play/pause workaround to reset audio
|
// Play/pause workaround to reset audio
|
||||||
aud.pause();
|
audi.pause();
|
||||||
aud.play();
|
audi.play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue