1 {% load soundfiles paniktags i18n %}
2 {% if sound|is_format_available:'mp3' or sound|is_format_available:'ogg' %}
3 <div class="audio" data-sound-id="{{ sound.id }}">
5 <button class="resymbol icon-plus-sign big"
6 title="{% trans "Add to playlist" %}"
7 data-sound-id="{{ sound.id }}"
8 data-player-audio="Audio-{{ sound.file.url|slugify }}"
9 data-player-action="registerAudio"
10 ><span class="sr-only">{% trans "Add to playlist" %}</span></button>
12 <button class="resymbol icon-play-sign big"
13 title="{% trans "Play" %}"
14 data-sound-id="{{ sound.id }}"
15 data-player-action="playAudio"
16 ><span class="sr-only">{% trans "Play" %}</span></button>
18 <button class="icons icon-pause big"
19 title="{% trans "Pause" %}"
20 style="display: none;"
21 data-sound-id="{{ sound.id }}"
22 data-player-action="pauseSounds"
23 ><span class="sr-only">{% trans "Pause" %}</span></button>
25 <button class="resymbol icon-download big"
26 title="{% trans "Download file" %}"
27 onclick="$(this).next().toggleClass('hidden-download-links');return false;"
28 ><span class="sr-only">{% trans "Download file" %}</span></button>
29 <div class="download-links hidden-download-links">
30 {% if sound|is_format_available:'ogg' %}
31 <a target="_blank" rel="noopener" class="button inBlock" href="{{ sound|format_url:'ogg' }}">
32 <span class="icon-file"> ogg</span>
35 {% if sound|is_format_available:'mp3' %}
36 <a target="_blank" rel="noopener" class="button inBlock" href="{{ sound|format_url:'mp3' }}">
37 <span class="icon-file"> mp3</span>
42 <button class="icon-share icons big"
43 title="{% trans "Embed" %}"
44 data-popup-href="{% url 'soundfile-dialog-embed-view' emission_slug=sound.episode.emission.slug episode_slug=sound.episode.slug pk=sound.pk %}"
45 ><span class="sr-only">{% trans "Embed" %}</span></button>
48 {% if display_fragment_name %}
49 <div class="fragment-name">
56 data-url="{% url 'episode-view' emission_slug=sound.episode.emission.slug slug=sound.episode.slug %}"
57 data-sound-id="{{ sound.id }}"
58 {% if sound.fragment and sound.title %}title="{{ sound.title }}"
59 {% else %}title="{{sound.episode.title}}"{% endif %}
60 preload="{% if preload %}{{ preload }}{% else %}none{% endif %}"
61 controls="{% if controls %}{{ controls }}{% else %}controls{% endif%}"
63 {% if sound|is_format_available:'ogg' %}
64 <source src="{{ sound|format_url:'ogg' }}" type="audio/ogg">
66 {% if sound|is_format_available:'mp3' %}
67 <source src="{{ sound|format_url:'mp3' }}" type="audio/mpeg">
69 <div class="alternative padded">
70 <div class="info smooth">Your browser can't play audio files</div>
71 <strong>Download: </strong>
72 {% if sound|is_format_available:'ogg' %}
73 <a class="icon-headphones" href="{{ sound|format_url:'ogg' }}"> ogg</a>
75 {% if sound|is_format_available:'mp3' %}
76 <a class="icon-headphones" href="{{ sound|format_url:'mp3' }}"> mp3</a>
80 <div class="waveform" data-sound-id="{{ sound.id }}" data-duration="{{ sound.duration }}"
81 data-duration-string="{{ sound.get_duration_string }}"></div>
83 <div class="hidden error">No sound available!</div>