send_to({command: [command]}, PATH_PLAYER); }
event_handlers.push(function(data) { // update player state
- for (const [id, text] of [['player_state', data.running ? (data.paused ? 'paused' : 'playing') : 'stopped'],
+ for (const [id, text] of [['playing_tags', data.title_tags ? `(tags: ${data.title_tags})` : ''],
['a_playing', data.title],
+ ['player_state', data.running ? (data.paused ? 'paused' : 'playing') : 'stopped'],
['btn_pause', data.paused ? 'resume' : 'pause'],
['btn_stop', data.running ? 'stop' : 'play']]) {
document.getElementById(id).textContent = text; }
<button onclick="player_command('next')">next</button>
<button id="btn_pause" onclick="player_command('pause')"></button>
<button id="btn_stop" onclick="player_command('stop')"></button>
-· <span id="player_state" /></span>: <a id="a_playing"></a>
+· <span id="player_state" /></span>: <a id="a_playing"></a> <span id="playing_tags"></span>
<hr />
{% block body %}
{% endblock %}
'running': self.server.player.is_running,
'paused': self.server.player.is_paused,
'title_digest': playing.digest.b64 if playing else '',
+ 'title_tags': ', '.join(playing.tags) if playing else '',
'title': str(playing.rel_path) if playing else 'none'}
if 'playlist' in params.as_dict:
data['playlist_files'] = [