Skip to content

Instantly share code, notes, and snippets.

@alexandre
Created January 16, 2014 17:21
Show Gist options
  • Save alexandre/8459226 to your computer and use it in GitHub Desktop.
Save alexandre/8459226 to your computer and use it in GitHub Desktop.
página html que exibe lista de músicas disponíveis e opção de ouvi-las.... Obs.: Usando Flask e templates...
{% extends 'layout.html' %}
{% block content %}
<h2>Avaliable Songs</h2>
<div class="avaliable-songs">
<audio class="audio" controls preload="auto">
<!-- ao selecionar uma música, é setado a variavel filename-->
<source src="/static/uploads/{{ filename }}" type="audio/mpeg"
id="filename" name="filename">
<span>Your browser does not support the audio element.</span>
</audio><hr/>
<div class="list-group">
{%for song in songs%}
<a href="{{ url_for('play',song=<passar a variavel song aqui>)}}" class="list-group-item">{{song}}</a>
<br><br>
{%endfor%}
</div>
</div>
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment