audio.html 1.02 KB
Newer Older
Simon Daron's avatar
Simon Daron committed
1
2
{% load soundfiles %}
{% if sound %}
Simon Daron's avatar
Simon Daron committed
3
4
5
6
7
8
9
10
11
	<!--
	<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 }}" 
Simon Daron's avatar
Simon Daron committed
12
		preload="{% if preload %}{{ preload }}{% else %}none{% endif %}"
Simon Daron's avatar
Simon Daron committed
13
14
		controls="{% if controls %}{{ controls }}{% else %}controls{% endif%}"
		>
Simon Daron's avatar
Simon Daron committed
15
16
17
18
19
20
		{% if episode.main_sound|is_format_available:'ogg' %}
			<source src="{{ sound|format_url:'ogg' }}" type="audio/ogg">
		{% endif %}
		{% if episode.main_sound|is_format_available:'mp3' %}
			<source src="{{ sound|format_url:'mp3' }}" type="audio/mpeg">
		{% endif %}
Simon Daron's avatar
Simon Daron committed
21
	</audio>  
Simon Daron's avatar
Simon Daron committed
22
{% else %}
Simon Daron's avatar
Simon Daron committed
23
	<div class="icon-ban-circle ">No sound!</div>
Simon Daron's avatar
Simon Daron committed
24
{% endif%}