Commit 329a8482 authored by Simon Daron's avatar Simon Daron
Browse files

Audio simple HTML5

parent 65043d2b
......@@ -34,15 +34,10 @@
</div>
{% endif %}
</a>
{% if episode.main_sound %}
<div class="sound">
{% include "includes/audio.html" with sound=episode.main_sound %}
</div>
{% endif %}
</div>
{% if episode.main_sound %}
<div class="sound">
{% include "includes/audio.html" with sound=episode.main_sound %}
</div>
<!--
<div class="controls todo right">
<button class="symbol play">A</button><button class="symbol add">B</button>
</div>
-->
{% endif %}
</div>
......@@ -27,14 +27,6 @@
<div class="content">
<h5 class="title"><a href="{{ episode.slug }}">{{ episode.title }}</a></h5>
{% if episode.main_sound|is_format_available:'ogg' %}
dispo en ogg, {{ episode.main_sound|format_url:'ogg' }}
{% endif %}
{% if episode.main_sound|is_format_available:'mp3' %}
dispo en mp3, {{ episode.main_sound|format_url:'mp3' }}
{% endif %}
{% if episode.description %}
<article class="text">
{{ episode.description|safe }}
......@@ -61,15 +53,10 @@
<li><button class="tag">Synthetiseur</button></li>
</ul>
</div>
{% if episode.main_sound %}
<div class="sound">
{% include "includes/audio.html" with sound=episode.main_sound %}
</div>
{% endif %}
</div>
{% if episode.main_sound %}
<div class="sound">
{% include "includes/audio.html" with sound=episode.main_sound %}
</div>
<!--
<div class="controls todo right">
<button class="symbol play">A</button><button class="symbol add">B</button>
</div>
-->
{% endif %}
</div>
{% load soundfiles %}
{% if sound %}
<span class="controls audioControls small" data-audio-controlNot="Audio-{{ sound.file.url|slugify }}">
<button class="playpause icon-play">{{ sound.content_types }}</button>
<button class="icon-eye-open" title="Show/Hidden HTML5 audio player" onclick="$('#Audio-{{ sound.file.url|slugify }}').toggleClass('hidden');$(this).toggleClass('icon-eye-open icon-eye-close');return false;"></button>
<a class="icon-download" href="{{ sound.url }}"></a>
</span>
<audio
id="Audio-{{ sound.file.url|slugify }}"
preload="{% if preload %}{{ preload }}{% else %}false{% endif %}"
{% if controls %}controls="{{ controls }}"{% endif%}
>
<!--
<span class="controls audioControls" data-audio-control="Audio-{{ sound.file.url|slugify }}">
<button class="playpause icon-play">{{ sound.content_types }}</button>
<button class="icon-eye-open" title="Show/Hidden HTML5 audio player" onclick="$('#Audio-{{ sound.file.url|slugify }}').toggleClass('hidden');$(this).toggleClass('icon-eye-open icon-eye-close');return false;"></button>
<a class="icon-download" href="{{ sound.url }}"></a>
</span>
-->
<audio
id="Audio-{{ sound.file.url|slugify }}"
preload="{% if preload %}{{ preload }}{% else %}false{% endif %}"
controls="{% if controls %}{{ controls }}{% else %}controls{% endif%}"
>
{% if episode.main_sound|is_format_available:'ogg' %}
dispo en ogg,
<source src="{{ sound|format_url:'ogg' }}" type="audio/ogg">
{% endif %}
{% if episode.main_sound|is_format_available:'mp3' %}
dispo en mp3,
<source src="{{ sound|format_url:'mp3' }}" type="audio/mpeg">
{% endif %}
</audio>
</audio>
{% else %}
<div class="icon-ban-circle ">No sound!</div>
{% endif%}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment