|
|
|
@ -4,7 +4,6 @@ |
|
|
|
<header class="topbar reveal"> |
|
|
|
<header class="topbar reveal"> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<h1>Tableau de bord</h1> |
|
|
|
<h1>Tableau de bord</h1> |
|
|
|
<p class="muted">Backend: {{ backend_url }} | Utilisateur: {{ username }}</p> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="topbar-actions"> |
|
|
|
<div class="topbar-actions"> |
|
|
|
<button type="button" class="danger" id="btn-stop-audio">Arreter l'audio</button> |
|
|
|
<button type="button" class="danger" id="btn-stop-audio">Arreter l'audio</button> |
|
|
|
@ -30,12 +29,20 @@ |
|
|
|
</label> |
|
|
|
</label> |
|
|
|
<label> |
|
|
|
<label> |
|
|
|
Fichier audio |
|
|
|
Fichier audio |
|
|
|
<input list="audio-files" name="music_file" id="music_file" placeholder="bell.mp3" required /> |
|
|
|
<div class="audio-select-row"> |
|
|
|
<datalist id="audio-files"> |
|
|
|
<select name="music_file" id="music_file" required |
|
|
|
|
|
|
|
data-stream-url="{{ url_for('ui.stream_audio', filename='__FILE__') }}"> |
|
|
|
|
|
|
|
<option value="" disabled {% if not audio_files %}selected{% endif %}> |
|
|
|
|
|
|
|
{% if audio_files %}Choisir un fichier…{% else %}Aucun fichier disponible{% endif %} |
|
|
|
|
|
|
|
</option> |
|
|
|
{% for f in audio_files %} |
|
|
|
{% for f in audio_files %} |
|
|
|
<option value="{{ f }}"></option> |
|
|
|
<option value="{{ f }}">{{ f }}</option> |
|
|
|
{% endfor %} |
|
|
|
{% endfor %} |
|
|
|
</datalist> |
|
|
|
</select> |
|
|
|
|
|
|
|
<button type="button" class="small btn-preview" id="btn-preview-trigger-audio" |
|
|
|
|
|
|
|
title="Prévisualiser le fichier sélectionné" |
|
|
|
|
|
|
|
{% if not audio_files %}disabled{% endif %}>▶</button> |
|
|
|
|
|
|
|
</div> |
|
|
|
</label> |
|
|
|
</label> |
|
|
|
<div class="time-row"> |
|
|
|
<div class="time-row"> |
|
|
|
<label> |
|
|
|
<label> |
|
|
|
@ -648,5 +655,24 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
})(); |
|
|
|
})(); |
|
|
|
|
|
|
|
(function () { |
|
|
|
|
|
|
|
const select = document.getElementById("music_file"); |
|
|
|
|
|
|
|
const btn = document.getElementById("btn-preview-trigger-audio"); |
|
|
|
|
|
|
|
if (!select || !btn) return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
btn.addEventListener("click", () => { |
|
|
|
|
|
|
|
const filename = select.value; |
|
|
|
|
|
|
|
if (!filename) return; |
|
|
|
|
|
|
|
const streamBase = select.dataset.streamUrl || ""; |
|
|
|
|
|
|
|
const url = streamBase.replace("__FILE__", encodeURIComponent(filename)); |
|
|
|
|
|
|
|
const player = document.getElementById("browser-audio-player"); |
|
|
|
|
|
|
|
const nowPlaying = document.getElementById("audio-now-playing"); |
|
|
|
|
|
|
|
if (!player) return; |
|
|
|
|
|
|
|
player.src = url; |
|
|
|
|
|
|
|
player.play().catch(() => {}); |
|
|
|
|
|
|
|
if (nowPlaying) nowPlaying.textContent = "Lecture: " + filename; |
|
|
|
|
|
|
|
player.closest("section")?.scrollIntoView({ behavior: "smooth", block: "nearest" }); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
})(); |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
{% endblock %} |
|
|
|
{% endblock %} |
|
|
|
|