forked from rc/aircox
		
	work on player
This commit is contained in:
		@ -3,6 +3,10 @@
 | 
			
		||||
Context objects:
 | 
			
		||||
- object: object to render
 | 
			
		||||
- hide_schedule: if true, hide the schedule
 | 
			
		||||
 | 
			
		||||
In case of modification, you might want to check on `assets/vue/player.vue`
 | 
			
		||||
for design review.
 | 
			
		||||
 | 
			
		||||
{% endcomment %}
 | 
			
		||||
 | 
			
		||||
{% if object|is_diffusion %}
 | 
			
		||||
 | 
			
		||||
@ -31,7 +31,7 @@
 | 
			
		||||
    {# <h4 class="subtitle size-4">{{ date }}</h4> #}
 | 
			
		||||
    {% with True as hide_schedule %}
 | 
			
		||||
    <table class="table is-striped is-hoverable is-fullwidth">
 | 
			
		||||
        {% for object in object_list reversed %}
 | 
			
		||||
        {% for object in object_list %}
 | 
			
		||||
        <tr>
 | 
			
		||||
            <td>
 | 
			
		||||
                {% if object|is_diffusion %}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										48
									
								
								aircox/templates/aircox/player.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								aircox/templates/aircox/player.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,48 @@
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
 | 
			
		||||
{% if audio_streams %}
 | 
			
		||||
<br>
 | 
			
		||||
 | 
			
		||||
<div class="box is-fullwidth is-fixed-bottom is-paddingless player"
 | 
			
		||||
        aria-role="{% trans "player" %}"
 | 
			
		||||
        aria-description="{% trans "audio player used to listen to streams and podcasts" %}"
 | 
			
		||||
    >
 | 
			
		||||
    <noscript>
 | 
			
		||||
        <audio src="{{ audio_streams.0 }}" controls>
 | 
			
		||||
            {% for stream in audio_streams %}
 | 
			
		||||
            <source src="{{ stream }}" />
 | 
			
		||||
            {% endfor %}
 | 
			
		||||
        </audio>
 | 
			
		||||
        {# TODO: live infos #}
 | 
			
		||||
    </noscript>
 | 
			
		||||
 | 
			
		||||
    <a-player ref="player" src="{{ audio_streams.0 }}"
 | 
			
		||||
            live-info-url="{% url "api-live" %}" live-info-timeout="15"
 | 
			
		||||
            button-title="{% trans "Play/pause audio" %}">
 | 
			
		||||
        <template v-slot:sources>
 | 
			
		||||
            {% for stream in audio_streams %}
 | 
			
		||||
            <source src="{{ stream }}" />
 | 
			
		||||
            {% endfor %}
 | 
			
		||||
        </template>
 | 
			
		||||
 | 
			
		||||
        <template v-slot:track="{ onAir }">
 | 
			
		||||
            <h4 class="title is-4">
 | 
			
		||||
                <span class="has-text-info is-size-3">♬</span>
 | 
			
		||||
                <span>[[ onAir.title ]]</span>
 | 
			
		||||
                <span class="has-text-grey-dark has-text-weight-light">
 | 
			
		||||
                — [[ onAir.artist ]]
 | 
			
		||||
                <i v-if="onAir.info">([[ onAir.info ]])</i>
 | 
			
		||||
                </span>
 | 
			
		||||
            </h4>
 | 
			
		||||
        </template>
 | 
			
		||||
 | 
			
		||||
        <template v-slot:diffusion="{ onAir }">
 | 
			
		||||
            <h4 class="title is-4">
 | 
			
		||||
                <a :href="onAir.url">[[ onAir.title ]]</a>
 | 
			
		||||
            </h4>
 | 
			
		||||
            <div class="">[[ onAir.info ]]</div>
 | 
			
		||||
        </template>
 | 
			
		||||
    </a-player>
 | 
			
		||||
</div>
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user