Commit 97051cfe authored by Simon Daron's avatar Simon Daron

Debug playlist load

parent 2565bdf0
......@@ -71,6 +71,13 @@ def emission_resume(context, date=None):
'schedules': context.get('schedules'),
}
@register.inclusion_tag('emissions/inline.html', takes_context=True)
def emission_inline(context, date=None):
return {
'emission': context.get('emission'),
'schedules': context.get('schedules'),
}
@register.inclusion_tag('includes/player.html', takes_context=False)
def player():
return {'unique': uuid.uuid4()}
......
var localList;
$(function() {
var $main = $("#Changing");
var $log = $("#userLog");
localList = $('#localList').playlist();
var $localList = $('#localList').playlist();
doLog = function(aTextToLog, type){
var aLog = $('<div>',{class:"log",html:'<div class='+type+'>'+aTextToLog+'</div>'});
aLog.hide().prependTo($log).show('fast').delay(10000).hide('fast', function() {
......@@ -91,7 +90,7 @@ $(function() {
try {
soundObj = JSON.parse(audio.children('code.json').html());
localList.playlist("registerSound",soundObj);
$localList.playlist("registerSound",soundObj);
}catch (e) { doLog('Sorry! audio is not well encoded in template'+e,'error'); }
return false;
});
......
{% load thumbnails %}
<div class="emission emission-inline inline">
<div class=" {% if emission.archived %}archived{% endif %}">
<a class="block" href="{% url 'emission-view' slug=emission.slug %}">
......
......@@ -22,6 +22,3 @@
</div>
</div>
{% endblock %}
{% block pageend %}
{% endblock %}
......@@ -53,26 +53,6 @@
</code>
</audio>
<button data-playlist-add="#Audio-{{ sound.file.url|slugify }}" class="icon-plus" id="addToPlaylist-{{ sound.file.url|slugify }}">Add to playlist</button>
<script type="text/javascript">
$(document).ready(function() {
var mainSound = {
source :{
{% if sound|is_format_available:'ogg' %}
"audio/ogg":"{{ sound|format_url:'ogg' }}",
{% endif %}
{% if sound|is_format_available:'mp3' %}
"audio/mpeg":"{{ sound|format_url:'mp3' }}",
{% endif %}
},
emission: "{{episode.slug}}",
episode: "{{episode.slug}}",
title: {{episode.title|jsonify|safe}},
id:"{{ sound.file.url|slugify }}"
}
});
</script>
{% else %}
<div class="error">No sound available!</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