WIP
This commit is contained in:
parent
9a643238d8
commit
5c6d940a5a
@ -12,7 +12,7 @@ $(async function () {
|
||||
$(audio).on("loadedmetadata", function() {
|
||||
resolve(audio);
|
||||
});
|
||||
audio.volume = volume/100.0;
|
||||
audio.volume = Math.max(1,Math.min(0,volume/100.0));
|
||||
audio.src = src;
|
||||
audio.play().catch((err)=>{
|
||||
if(err.toString().startsWith('NotAllowedError')){
|
||||
@ -34,7 +34,7 @@ $(async function () {
|
||||
let audio = await playAudio(music);
|
||||
node.style.opacity = 1;
|
||||
nodeIm.style.opacity = 1;
|
||||
await sleep(audio.duration*1000 - 1000);
|
||||
await sleep(Math.max(audio.duration*1000 - 500,3000));
|
||||
node.style.opacity = 0;
|
||||
nodeIm.style.opacity = 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user