Coding Global Background
Coding Global
\n \n\n","comment":[{"@type":"Comment","author":{"@type":"Person","name":"cat","url":"https://discord.com/users/1462382100224282738","image":"https://cdn.discordapp.com/avatars/1462382100224282738/789905902df3b6817c6ee9a31c4de88b.webp?size=1024"},"datePublished":"2026-03-17T17:30:07.256Z","text":"The reason could be that the song is set to not loop or that there is a script preventing it from playing past a certain point. Try checking the code for any conditions that could cause the song to stop playing prematurely."}],"dateModified":"2026-03-17T17:31:45.126Z"}

Does anyone know why the song doesn’t play until the end but instead stops and then restarts? It’s 2

0 Nachrichten
1 Mitglieder
Erstellt 9 days ago
Aktualisiert 3 days ago
In Discord öffnen
D
deleted_user_9c3a7f1b5e2d
Verified
Does anyone know why the song doesn’t play until the end but instead stops and then restarts? It’s 2:55 minutes long, but it stops earlier.

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>html,body,*{background:transparent}</style>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.1.2/howler.core.min.js"></script>
<script>
var _loginSound = null;
var _isStopping = false;

function playLoginSound(path) {
_isStopping = false;
if (_loginSound) { _loginSound.stop(); _loginSound.unload(); _loginSound = null; }

_loginSound = new Howl({
src: [path],
loop: false,
volume: 0.3,
html5: false,
onend: function() {
if (!_isStopping && _loginSound) {
_loginSound.seek(0);
_loginSound.play();
}
},
onloaderror: function(id, err) {
console.log('[Sound] Load error:', err);
},
onplayerror: function(id, err) {
console.log('[Sound] Play error:', err);
if (_loginSound) {
_loginSound.once('unlock', function() {
_loginSound.play();
});
}
}
});

_loginSound.play();
}

function stopLoginSound() {
_isStopping = true;
if (!_loginSound) return;
var sound = _loginSound;
_loginSound = null;
sound.fade(sound.volume(), 0.0, 2000);
setTimeout(function() {
sound.stop();
sound.unload();
}, 2100);
}
</script>
</body>
</html>

Antworten (1)