modified: templates/quiz_multiplayer.html
This commit is contained in:
@@ -96,7 +96,13 @@ function startMultiplayer(e) {
|
||||
updateMultiplayerUI();
|
||||
quizifyReady();
|
||||
}
|
||||
window.addEventListener('DOMContentLoaded', fillPlayerFields);
|
||||
window.addEventListener('DOMContentLoaded', function() {
|
||||
fillPlayerFields();
|
||||
// Popup IMMER anzeigen, falls vorhanden
|
||||
if (document.getElementById('multiplayerPopup')) {
|
||||
document.getElementById('multiplayerPopup').style.display = 'flex';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
<script>
|
||||
@@ -105,6 +111,7 @@ let currentGameMode = "{{ game_mode }}";
|
||||
let correctAnswer = "";
|
||||
const i18n = {{ translations|tojson }};
|
||||
|
||||
// Spotify Web Playback SDK
|
||||
window.onSpotifyWebPlaybackSDKReady = () => {
|
||||
const token = '{{ access_token }}';
|
||||
const player = new Spotify.Player({
|
||||
@@ -267,18 +274,11 @@ window.onload = function() {
|
||||
}
|
||||
document.getElementById('startPosition').value = getOption('startPosition', 'start');
|
||||
updateMultiplayerUI();
|
||||
|
||||
// Popup immer anzeigen, falls vorhanden
|
||||
if (document.getElementById('multiplayerPopup')) {
|
||||
document.getElementById('multiplayerPopup').style.display = 'flex';
|
||||
}
|
||||
};
|
||||
|
||||
// Musikstart und Quiz erst nach Namensbestätigung!
|
||||
function quizifyReady() {
|
||||
// Musik abspielen
|
||||
if (window.spotifyPlayer && window.spotifyPlayer._options && window.spotifyPlayer._options.getOAuthToken) {
|
||||
// Player ist schon initialisiert
|
||||
const device_id = document.getElementById('device_id').value;
|
||||
const playDuration = getPlayDuration();
|
||||
const startPosition = getOption('startPosition', 'start');
|
||||
|
||||
Reference in New Issue
Block a user